> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leapter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a blueprint inside n8n

> Download the Code workflow from the Admin UI: an n8n workflow with the blueprint's logic as JavaScript, which runs without calling the runtime cluster.

The **Code workflow** puts a blueprint's logic into an n8n Code node as JavaScript. The workflow runs the logic inside n8n and never calls the runtime cluster, so it needs no evaluation key. Use it when an n8n workflow should run a blueprint without a connection to the cluster. To call the cluster instead, use the HTTP workflow ([Call a release from n8n](https://docs.leapter.com/rc/user-guide/call-from-n8n.md)).

## Before you start

* The application is deployed to the environment ([Deploy a release and call it](https://docs.leapter.com/rc/user-guide/deploy-and-call.md)). The Admin UI builds the workflow from the release the environment serves. You need no evaluation key.
* You can sign in to the Admin UI, and you hold `content:read` in the environment, for example as an auditor. Without it, the **n8n** card says "You need the content:read right".
* An n8n instance. The steps were run with n8n 2.44.5; other versions may name the menu items differently.

## Steps

**1. Download the workflow**

Open the Admin UI (the cluster address followed by `/runtime-management/ui/`), click **Sign in with Leapter** and sign in with the account you use for the Lab. The Admin UI may open on another environment: click the environment's name at the bottom of the sidebar and choose yours in the list that opens. Then click the application's name on the **Status** page, and scroll down to the **n8n** card. Under **Blueprints**, click **Code workflow** next to the blueprint. Your browser saves a file such as `pizza-pricing-calculator-180269-playground-pizza_pricing-code.json`.

The card says that the Code workflow runs the logic inside n8n and needs no key. It calls nothing, so it has no `X-API-Key` header to fill in.

![The Admin UI application page, scrolled to the n8n card. Under Blueprints, Pizza Pricing has the buttons HTTP workflow and Code workflow. Code workflow has a green ring.](https://mintcdn.com/leapter/3NthIZmfsFFgUhyn/rc/user-guide/images/admin-n8n-code-workflow.png?fit=max\&auto=format\&n=3NthIZmfsFFgUhyn\&q=85\&s=e708eacd027843a6b2e8747d83a95b38)

The Code workflow button of the blueprint Pizza Pricing.

**2. Import it into n8n**

Sign in to n8n and create a new workflow: click **+** at the top of the left sidebar, then **New workflow**. Open the workflow menu (**…** next to the workflow name), choose **Import**, then **From file**, and select the downloaded file.

The workflow is renamed to "Code example - Pizza Pricing". You should see three nodes: **Form Trigger**, **Pizza Pricing** and **Form**. The node **Pizza Pricing** is a Code node with the blueprint's logic. Double-click it to read the JavaScript; you do not need to change it. Close the node with **×** at its top right. You do not need to save or publish the workflow to run it.

![An n8n canvas with three connected nodes: Form Trigger, Pizza Pricing with a curly-brace icon and a green ring, and Form with the subtitle Form Ending.](https://mintcdn.com/leapter/3NthIZmfsFFgUhyn/rc/user-guide/images/n8n-code-workflow.png?fit=max\&auto=format\&n=3NthIZmfsFFgUhyn\&q=85\&s=824755e06425095f7a33d8778d07a5d2)

The imported Code workflow, with the Code node Pizza Pricing in the middle.

**3. Run the workflow**

Click **Execute** below the canvas. n8n opens the form **Input Data** in a new tab, with the note "This is a test version of your form". Fill in the fields:

| Field | Value |
| :- | :- |
| pizzaSize | `large` |
| toppings | `["mushroom", "olive"]` |
| crustType | `thin` |
| dayOfWeek | `friday` |

Click **Submit**.

## Result

The form shows **Run complete** and the blueprint's outputs, the same outputs a call to the runtime cluster returns for these inputs.

![An n8n form page that says Run complete: totalPrice 20.9, basePrice 16, toppingsCost 3, crustUpcharge 0, subtotal 19, dayMultiplier 1.1, weeklyPrices 19, 15.2, 17.1, 19, 20.9, 21.85, 19.](https://mintcdn.com/leapter/3NthIZmfsFFgUhyn/rc/user-guide/images/n8n-run-complete.png?fit=max\&auto=format\&n=3NthIZmfsFFgUhyn\&q=85\&s=f1c50e426c63ff11c4a1c95201bd466e)

The result of the run, shown by the workflow's last node.

The logic ran inside n8n. The runtime cluster received no call, so the Admin UI's **Runs** and **Usage** pages do not show this run.

The Code node holds the logic of the release the environment served when you downloaded the file. After a new deploy or a roll back, the workflow still runs the old logic. Download the Code workflow again and import it to get the new one.

## When to use Code vs HTTP

| | Code workflow | HTTP workflow |
| :- | :- | :- |
| Calls the runtime cluster | No, the logic runs inside n8n | Yes, on every run |
| Evaluation key | Not needed | Needed in the `X-API-Key` header |
| Which release runs | The one the environment served when you downloaded the file | The one the environment serves at the time of the call |
| After a deploy or a roll back | Download and import the workflow again | Nothing to do |
| Recorded on the runtime cluster | No | Yes, as a run on the **Runs** and **Usage** pages |
| Use it for | An n8n instance that cannot reach the runtime cluster | Logic that follows each deploy, and runs that the cluster must record |

## Troubleshooting

**After Sign in with Leapter, you are in the Lab and not in the Admin UI, or the Lab says "This sign-in cannot go on." and "authorization not found".** Open the Admin UI's address again and click **Sign in with Leapter** once more. The **Status** page opens.

## What to do next

* [Call a release from n8n](https://docs.leapter.com/rc/user-guide/call-from-n8n.md): the HTTP workflow, which calls the runtime cluster.
* [Use your blueprints in an n8n AI agent](https://docs.leapter.com/rc/user-guide/n8n-mcp-agent.md): the MCP workflow.
* [Find a run and read usage](https://docs.leapter.com/rc/user-guide/runs-and-usage.md): what the cluster records for a call.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.