feat: n8n workflow JSON import at deploy time#237
Conversation
- Add workflowJson Json? field to Service model (migration included) - Add startCommand to n8n template: decodes N8N_IMPORT_WORKFLOW_B64 env var and runs `n8n import:workflow` before `n8n start`; no-op when var is absent so existing deployments are unaffected - Add workflowJson: JSON field to DeployFromTemplateInput and DeployToAkashInput GraphQL types - deployFromTemplate resolver: persist workflowJson on service and create N8N_IMPORT_WORKFLOW_B64 ServiceEnvVar (base64-encoded) - deployToAkash resolver: upsert N8N_IMPORT_WORKFLOW_B64 ServiceEnvVar when workflowJson is supplied at (re)deploy time Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Quinn QA ReviewVerdict: REQUEST CHANGES
Test coverage findingsBlocker: zero new tests for all new code paths. The PR description claims "All 847 existing tests pass" — confirmed, the suite is green. But the 847 tests cover none of the new behaviour. Missing coverage:
Regression risksLow overall, but one area to verify:
Code quality and maintainabilityClean code overall. Minor notes:
Security implications (flagging for Lain's deeper review)
Blockers
Suggested follow-ups (non-blocking)
|
Summary
workflowJson Json?field to theServicePrisma model (migration included)n8ntemplate definition with astartCommandwrapper that decodesN8N_IMPORT_WORKFLOW_B64env var, runsn8n import:workflow --input=/tmp/wf.json, thenexec n8n start. No behaviour change when env var is absent.workflowJson: JSONfield toDeployFromTemplateInputandDeployToAkashInputGraphQL typesdeployFromTemplateresolver: storesworkflowJsonon the service and creates aN8N_IMPORT_WORKFLOW_B64ServiceEnvVar(base64-encoded JSON) when the template isn8ndeployToAkashresolver: upsertsN8N_IMPORT_WORKFLOW_B64whenworkflowJsonis supplied at (re)deploy time — the existinginjectPersistedEnvVarspipeline merges it into the SDL env block automaticallyTest plan
pnpm test)pnpm build)workflowJson— container starts normally, no import stepPart of https://github.com/alternatefutures/web-app.alternatefutures.ai/issues/64
🤖 Generated with Claude Code