Skip to main content

Building Workflows

This guide walks you through creating a workflow step by step in the console's workflow editor.

Opening the workflow editor​

  1. Go to Collections → open a collection
  2. On the proxy's row, click Workflow

The editor has one header bar and a canvas:

  • Header: a breadcrumb back to the route (collection › method and path), the Active switch, the save state (Saved or Unsaved changes), Save, and a ⋯ menu with Templates, Full screen and Validate. The back arrow asks before leaving if you have unsaved changes.
  • Canvas: steps flow from left to right. Each step is a card with a coloured icon, its name and a one-line summary of its key settings. Inputs are on the left edge, labelled outputs on the right edge. The trigger that starts the workflow has a rounded left edge and no input.
  • Bottom left: fit to view, zoom in, zoom out and Tidy up. Bottom centre: Test workflow and Listen for a request.

A template keeps its HTTP trigger's method (many take POST). If the proxy does not allow that method, the builder shows a warning above the canvas: requests with that method get 405 and the workflow does not run until you add the method to the proxy's allowed methods. The warning is also shown to read-only users.

Build it on this page or use an existing workflow​

Every workflow is a workflow like any other, listed in Automation › Workflows, whether it was built on a proxy page or in Workflows. A route either runs the workflow built on its own page or uses an existing workflow. The chip next to the route in the header shows which: Built on this page (with used by n proxies when others use it too) or Uses: name. Editors click it (· Change) to choose:

  • Build it on this page: the editor described on this page.
  • Use an existing workflow: pick from every workflow whose only trigger is Incoming request: workflows published in Workflows, and workflows built on another proxy's page (shown as built on a proxy page; they run as that proxy has them). The workflow you pick replaces the steps built on this page for this route; to keep those steps as a separate workflow, copy them into Workflows first with New workflow › From a proxy. The console sends PUT /api/v1/proxies/:id/workflow with {"workflow_id": "<id>"} (a proxy-built workflow's id is its proxy's id) and shows the API's warnings, for example the other proxies that run the same workflow.

When other proxies use the workflow built on this page, a banner names them, and saving here updates them as well: their routes run the saved steps at once (each keeps its own Active switch). The save answer lists the proxies it updated.

A route that uses an existing workflow shows it read-only: a banner names the workflow and how many other proxies use it. Edit on proxy name opens the page of the proxy it was built on; Edit in Workflows opens a workflow from Workflows, where you change and publish it. Either way every proxy that uses it gets the change. The Active switch still works on this page and turns the workflow on or off for this route only. Save, Templates and Validate are not offered, because the proxy routes refuse definition changes for a proxy that uses another workflow (409).

Build it on this page instead (in the banner, or Build it on this page in the chooser) sends {"workflow_id": ""}. The route keeps the current steps of the workflow it used as a workflow built on its own page, which you can then edit here; later changes to the other workflow no longer reach it. On the collection page, a route that uses another workflow shows a Shared workflow badge instead of Workflow.

A proxy that switches to another workflow can do so even while other proxies use the workflow built on its page: the workflows store keeps that workflow, and the proxies that use it keep running it.

Viewers see which workflow a route runs and the read-only canvas, but cannot change the choice.

Starting a workflow​

An empty workflow shows Add the first step. Click it to choose what starts the workflow; for a route this is usually Incoming request (http_trigger). A new Incoming request step takes the route's method and path.

You can also start from a prebuilt template (orchestration, transformation, resiliency, canary): click Or start from a template on the empty canvas, or ⋯ › Templates at any time.

Adding steps​

  • From an output: every output that is not connected yet shows a +. Click it, pick a step, and the new step is placed to the right, connected from that output, and its settings open.
  • In the middle of a connection: hover a connection (or click it) and click + to insert a step. Steps after it move one column to the right.
  • From the keyboard: select a step and press Tab to add a step after its first open output.
  • Drag: drag a step from the picker onto the canvas, then connect it by dragging from an output to an input.

The picker lists steps in seven groups: Triggers, Flow, Data & transform, AI, Databases, Send & call and Respond. Type to search across all of them (names, descriptions and the node type id, so condition finds If), use the arrow keys and Enter to choose, and Esc to close. On an empty canvas the picker only offers triggers. A proxy's workflow has exactly one trigger; a standalone workflow can have several (at most one of each type, except schedules).

GroupSteps
TriggersIncoming request, Manual, Schedule, Kafka message, Incoming email, Called by Workflow
FlowIf, Switch, Loop, Parallel, Merge, Wait, Execute workflow, Stop
Data & transformSet fields, Code, Validate, XML, JWT, Crypto
AILLM, AI Agent
DatabasesPostgreSQL, MongoDB, SQL Server, Oracle, Redis
Send & callHTTP request, Forward to upstream, Kafka publish, Send email (SMTP), Send email (SendGrid)
RespondRespond, Redirect, Return

Connecting steps​

Output handles are labelled on the step and on the connection:

  • one unlabelled output for triggers and steps that always continue (Set fields, Wait, Parallel, Merge, Kafka publish)
  • success / error for steps that can fail (HTTP request, databases, Code, LLM, ...)
  • valid / invalid for Validate, and for Crypto and JWT when they verify
  • loop (each item) / done for Loop
  • your own names for If and Switch branches, plus their default output

Drag from an output to another step's input to connect them by hand.

Removing steps and connections​

  • Select a step and click Delete in the small toolbar above it, or press Delete / Backspace. If the step had exactly one connection in and one out, the two neighbours are reconnected.
  • Hover a connection and click the bin to delete it.

Configuring a step​

Double-click a step, select it and press Enter, or click Open in the toolbar above a selected step. The step editor opens over the canvas (the canvas stays as it is) with three columns:

  • Input: the data of every earlier step from the last test, grouped by step with the nearest first. Steps that have not run yet show the fields of their output schema. Drag a field onto a parameter to insert an expression such as {{$json['price_order'].result.total}} (Code and If steps get the plain JavaScript form $json['price_order'].result.total).
  • Parameters: the step's inputs and options. Click the step name in the header to rename it; expressions that refer to it are updated.
  • Output: what the step returned in the last test, or its schema.

Below 820px wide the three columns become Input / Parameters / Output tabs. Press Esc or click Canvas to close. See the Node Reference for each step's fields.

Fields that support expressions use {{ expression }} syntax. For example:

URL: https://api.example.com/users/{{ $json['http_trigger'].request.path_params.userId }}

Tidy up​

Tidy up (bottom left) lays the workflow out from left to right, with branches in output order (for example success above error). It is the only thing that moves steps for you: positions you saved are never changed automatically, so workflows built in the earlier top-to-bottom editor keep their layout until you click it.

Keyboard shortcuts​

KeysAction
TabAdd a step after the selected step
EnterOpen the selected step
Delete / BackspaceDelete the selected step (or connection)
EscClose the picker or step editor, then clear the selection
Ctrl/Cmd + EnterTest workflow
Ctrl/Cmd + SSave
Shift + 1Fit to view

Example: Enrich response with database data​

Goal: When a client requests /orders/{orderId}, fetch the order from the backend, then look up the customer details from MongoDB, and return a merged response.

Workflow:

1. http_trigger
2. proxy_node (GET /orders/{orderId} from backend)
3. mongodb_node (find customer by customerId from order)
4. set_node (build combined response object)
5. response_node (return to client)

Step 1: After http_trigger, add a proxy_node (Forward to upstream)

  • Path: {{ $json['http_trigger'].request.path }}
  • Method: {{ $json['http_trigger'].request.method }}

Step 2: Add a mongodb_node

  • Credential: select your MongoDB credential
  • Collection: customers
  • Operation: find_one
  • Filter: { "id": "{{ $json['proxy_node'].response.body.customerId }}" }

Step 3: Add a set_node (Set fields) to merge

  • Set result.order = {{ $json['proxy_node'].response.body }}
  • Set result.customer = {{ $json['mongodb_node'].document }}

Step 4: Add a response_node (Respond)

  • Status: 200
  • Body: {{ JSON.stringify($json['set_node'].result) }}

Example: Mock an API (no backend)​

Goal: Return a static response without any backend.

Workflow:

http_trigger → response_node

In response_node:

{
"status": 200,
"headers": { "Content-Type": "application/json" },
"body": "{\"message\": \"Hello from Zerq!\", \"items\": [1, 2, 3]}"
}

This is useful for building API stubs while the real backend is in development.

Example: Conditional routing​

Goal: Route to different backends based on the request's plan query parameter.

Workflow:

1. http_trigger
2. condition_node (plan == "enterprise")
3. true branch -> http_request_node (enterprise backend)
4. false branch -> http_request_node (standard backend)
5. both branches connect to response_node

condition_node (If) config:

  • Condition: $json['http_trigger'].request.query.plan === 'enterprise'
  • True branch → enterprise node
  • False branch → standard node

Testing a workflow​

Testing works regardless of whether the workflow is active or not.

Test runs execute real nodes (for example an http_request_node with its stored credential) and listen sessions capture real requests or email, so every test mode requires the modifier role, the same as saving a workflow. The API returns 403 Insufficient permissions for viewer-only tokens.

Test workflow​

Click Test workflow at the bottom of the canvas, or press Ctrl/Cmd + Enter, to run the graph with the trigger's sample data (for http_trigger, the route's method and path are used when the trigger has none). While it runs and afterwards, the canvas shows the result:

  • steps that ran turn green, the step that failed turns red with its error message underneath, and steps that caught their own failure and continued on their error or invalid branch turn amber with the message underneath
  • steps that did not run are dimmed
  • the connections the run went along are highlighted, with their branch label

Click a step after a run to open it with its input and output data. If the run fails before any step reports an error, the message appears above the Test workflow button.

To test one step on its own, select it and click the Test step button in its toolbar, or open it and click Test step in the step editor.

Trigger test-listen modes​

For trigger steps that wait for external events, click Listen for a request (or Listen for an email) next to Test workflow, or use the listen panel in the trigger's step editor:

TriggerTest modeHow it works
http_triggerListen for a requestOpens a temporary URL; send an HTTP request to it and the payload is captured
imap_triggerListen for an emailConnects read-only to IMAP; waits for the first unseen email
cron_triggerTest workflowRuns immediately with a mock triggered_at timestamp
kafka_consumerTest workflowRuns immediately with mock Kafka message fields
manual_triggerTest workflowRuns immediately with a mock triggered_at timestamp

After a trigger event is captured, the downstream workflow runs automatically so you can inspect all step outputs in one pass. See Testing: Listen for Trigger for full details.

View-only access​

Users with only the viewer role see the workflow with a View only pill in the header. They can pan, zoom, select steps and open them (settings are shown disabled), but there is no +, insert, delete, drag, Tidy up, Save or test bar.

Saving vs activating​

Save (or Ctrl/Cmd + S) and the Active switch are independent actions.

ActionWhat it doesValidated?
Save while offPersists the workflow definition as a draftNo: drafts can be incomplete
Save while activePersists the new definition, which goes live at onceYes: an invalid definition is rejected and the live workflow is left unchanged
Active switch onActivates the saved workflow and its production triggers (IMAP scheduler, cron, Kafka consumer)Yes: an invalid definition cannot be activated

The header shows Saved or Unsaved changes, and Save is only enabled with unsaved changes (adding, removing or moving steps, changing settings, reconnecting). Opening a workflow and saving it without changes stores the same definition: the editor does not fill in defaults or move steps on load (it only drops React Flow measurement fields such as width and height, as it always has). If you leave with the back arrow while there are unsaved changes, the editor asks whether to leave without saving; refreshing or closing the tab shows the browser's prompt.

Activating a workflow does not automatically save. Likewise, saving does not start production triggers — triggers only run when the workflow is both active and in published status.

When a workflow is off, a strip under the header says so, and you can still:

  • Edit the canvas and save, even when the workflow is not valid yet
  • Run test modes (Test workflow, Listen for a request, Listen for an email)

When a workflow is active, every save is checked before it is stored. If the new definition fails validation, the save is rejected with the validation message and the proxy keeps running the last saved definition. To work on a larger change step by step, turn the workflow off first, or fix the problem and save again.

The same rule applies to the management API and the Management MCP: PUT /api/v1/proxies/:id/workflow and PUT /api/v1/proxies/:id (and the update_proxy_workflow MCP tool) return 400 with {"error": "..."} when a request enables a workflow, or changes an enabled workflow's definition, to one that fails validation. A request that sends the stored definition back unchanged (for example, editing only a proxy's name) is not re-validated. Creating a proxy with POST /api/v1/proxies follows the same rule: workflow_enabled: true with an invalid or missing workflow_definition returns 400, while a disabled workflow is saved as a draft. If the console's proxy form gets one of these errors, it shows the message and stays open so you can fix it.

Collection import does not validate workflow definitions, so older exports import unchanged.

Activating / deactivating​

Use the Active switch in the header (or Turn on in the strip) to activate or deactivate production execution without deleting the workflow.

  • Active: production triggers (cron scheduler, Kafka consumer, IMAP scheduler) run. For http_trigger workflows the proxy routes live traffic through the workflow engine, for the proxy's allowed methods only; other methods get 405.
  • Off: production triggers are stopped. The proxy falls back to simple pass-through forwarding. All test modes remain available.

Validating a workflow​

Choose ⋯ › Validate to run the backend's workflow validation without saving. It checks that:

  • The definition parses as a workflow (nodes and edges)
  • It has exactly one entry trigger node (http_trigger, manual_trigger, cron_trigger, kafka_consumer, imap_trigger or workflow_trigger) when a proxy runs it; a standalone workflow may have several, at most one per type except cron_trigger (see Several triggers)

This is the same check that runs when you activate a workflow or save one that is active. It does not check node configuration, expressions, edge wiring or branch handles; use the test modes to prove those before activating.