Code Workflow
Leapter can generate an n8n workflow that runs your Blueprint logic entirely within n8n. Instead of calling an external API, the workflow contains your Blueprint transpiled to JavaScript in a Code node. This means no network latency, no API key required at runtime, and no dependency on external services.
What this creates
The Code Workflow is a 3-node n8n workflow:
| Node | Purpose |
|---|
| Form Trigger | Displays a form with input fields matching your Blueprint’s data contract |
| Code | Contains your full Blueprint logic transpiled to JavaScript — executes directly in n8n |
| Form | Displays the results |
Export the workflow
- Open your Blueprint in the editor.
- Click the Share button in the toolbar.
- Select n8n.
- In the Export to n8n dialog, select the Code Workflow tab.
- Click Copy to Clipboard.
Import into n8n
- Open your n8n instance.
- Create a new workflow.
- Click the three-dot menu (or use Ctrl+V / Cmd+V) and select Import from clipboard.
- The 3-node workflow appears on the canvas.
How the Code node works
The Code node contains your Blueprint logic transpiled to JavaScript. You can open it to inspect the code, but you do not need to modify it. The code:
- Reads inputs from the Form Trigger node
- Executes your Blueprint’s logic (conditions, calculations, data transformations)
- Returns the outputs for the final Form node to display
Since the code is a snapshot of your Blueprint at export time, you need to re-export the workflow if you update your Blueprint.
Run the workflow
- Click Test Workflow to run it manually.
- Fill in the form with your test inputs.
- The Code node executes your logic and the Form node displays the results.
No API key or network connection to Leapter is needed at runtime.
When to use Code vs HTTP
| Code Workflow | HTTP Workflow |
|---|
| API dependency | None — runs locally | Requires Leapter API |
| Authentication | Not needed at runtime | API key required |
| Updates | Re-export after Blueprint changes | Always calls latest published version |
| Best for | Offline use, low latency, self-contained workflows | Always-current logic, no re-export needed |
What to do next