Skip to content

feat: add n8n as a second workflow runtime alongside Node-RED#41

Open
manihagh wants to merge 1 commit intomasterfrom
n8n-runtime-v2
Open

feat: add n8n as a second workflow runtime alongside Node-RED#41
manihagh wants to merge 1 commit intomasterfrom
n8n-runtime-v2

Conversation

@manihagh
Copy link
Copy Markdown

Rebased from #38 onto v1.7.0 (after #34 reorganized the project structure).

What this adds

A second workflow runtime that runs alongside Node-RED. Solutions whose chain-declared executionEnvironment is N8nV1 are installed into n8n; every other solution continues to run on Node-RED exactly as before. Both runtimes share the same vote submission pipeline.

See docs/runtime-n8n.md for architecture details.

Review feedback from #38

All addressed in this branch:

  • Runtime interface exposes getHealth(); health.ts is pure iteration across ALL_RUNTIMES
  • startAllRuntimes / deleteAllFromAllRuntimes helpers in registry.ts
  • SolutionIdentifier discriminated type used in routes/vote.ts and routes/worker-config.ts
  • RUNTIME-N8N.md moved to docs/runtime-n8n.md

Tested end-to-end on mainnet

  • vcc-1 installed into n8n via DEV_LOCAL_FLOW_OVERRIDES
  • Vote submitted and settled on chain
  • Graceful shutdown drains vote queue and terminates n8n child cleanly
  • Node-RED flows continue working unchanged (NodeRedV1 default)

Configuration

Three new optional env vars (see .env.default):

  • N8N_INTERNAL_PORT (default 5678)
  • DEV_RUNTIME_OVERRIDES (dev-only)
  • DEV_LOCAL_FLOW_OVERRIDES (dev-only)

When no solution uses executionEnvironment: N8nV1, the n8n child process still starts but stays idle. No manual setup required.

}, timeoutMs);
});

await Promise.race([n8nReadyPromise, timeout]);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need reset timer when n8nReadyPromise return before timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants