Skip to content

Updating visuals

If you see any images containing outdated UI, please bear with us.

We are updating all content as quickly as possible to mirror our new UI.

n8n integration ​

n8n is a workflow automation platform that lets you connect apps, APIs and AI into automated workflows — on n8n Cloud or self-hosted. This integration lets your WeWeb backend trigger webhook-based n8n workflows and inspect their executions.

Use cases ​

  • Offload heavy or long-running automation (data syncs, enrichment, AI pipelines) to n8n
  • Trigger an n8n workflow when something happens in your app (new order, new signup)
  • Reuse existing n8n automations from WeWeb without rebuilding them
  • Monitor workflow runs by listing and inspecting executions from your backend

Setup ​

  1. Copy your n8n instance URL (e.g. https://your-name.app.n8n.cloud for n8n Cloud, or your self-hosted host).
  2. In n8n, open Settings → n8n API and create an API key.
  3. In WeWeb, open the Data & API tab, then the Integrations subtab. Select n8n, then click Add Connection.
  4. Set the connection fields — the connection applies to all environments (Editor, Staging, Production); to use different values per environment, override the generated environment variables:
    • Instance URL — The root URL of your n8n instance.
    • API Key — The key you created in n8n.
    • Webhook base URL — Optional. Only for self-hosted instances that serve webhooks from a different host (via the WEBHOOK_URL environment override). Defaults to the instance URL when empty.
  5. Test with List Executions — if your credentials are correct, it returns your instance's recent executions.

How triggering works ​

n8n has no public API to run a workflow directly by its ID — the production webhook is the only external trigger. This shapes how the integration works:

  • Only workflows with a Webhook trigger node appear in the Trigger Workflow dropdown.
  • The workflow must be published in n8n: production webhooks only register once the workflow is published.
  • By default (Respond: Immediately on the Webhook node), triggering returns {"message":"Workflow was started"} right away without waiting for the run to finish.
  • To get real output back, end the workflow with a Respond to Webhook node and return the data you need there.
  • To track a run you just triggered, have the Respond to Webhook node output the run's execution ID (see the example below), then pass that ID to Get Execution.

Example: trigger a workflow and track its run ​

  1. In n8n, set the Webhook node's Respond option to Using 'Respond to Webhook' node, then add a Respond to Webhook node at the end of the workflow. On that node, set Respond With to JSON (it defaults to First Incoming Item, and the Response Body field only appears once you pick JSON), then switch Response Body to Expression and enter:
    json
    { "executionId": "{{ $execution.id }}" }
    {{ $execution.id }} is an n8n expression — you type it in n8n (inside the Respond to Webhook node), not in WeWeb, and n8n replaces it with the run's actual ID when the workflow executes. The field has to be in Expression mode: left in Fixed mode, n8n returns the text {{ $execution.id }} as-is instead of the ID. (Putting it on the Webhook trigger node itself doesn't work either — it evaluates to undefined there, a known n8n limitation.)
  2. In WeWeb, run Trigger Workflow — it now returns something like { "executionId": "12345" }.
  3. Pass that ID to Get Execution (bind the Execution ID input to the previous step's executionId) to read the run's status — success, error, running, etc.

The Data field of Trigger Workflow is pre-filled with the webhook's expected fields, inferred from the sample payload pinned on the Webhook node or, failing that, from the workflow's latest successful execution. If no fields appear, run the workflow once (or pin sample data on the Webhook node in n8n), then refresh.

Using n8n as a data source for tables ​

You can create WeWeb tables backed by your n8n instance with the executions resource. The table exposes the columns id, status, mode, startedAt, stoppedAt, finished, and workflowId, and its views can be filtered by Workflow and Status with a configurable page size (default 50, max 250).

Execution views use cursor pagination: each page returns a cursor for the next one, so you cannot jump to an arbitrary numeric offset.

Common pitfalls (setup & usage) ​

n8n Cloud free trial has no API access ​

The n8n Cloud free trial does not include the public API. All actions and the workflow dropdown fail with an auth error until the instance is upgraded to a paid plan.

Workflow not published ​

A 404 from Trigger Workflow usually means the workflow is not published (production webhooks only register once the workflow is published in n8n) or the webhook path changed. Publish the workflow in n8n and retry.

Webhook uses Header Auth ​

n8n never exposes webhook authentication secrets through its API. If the Webhook node uses Header Auth, add the header name and secret value manually in the Headers field of Trigger Workflow.

No fields in the Data input ​

The expected fields are inferred from a sample payload pinned on the Webhook node, or from the latest successful execution. If neither exists, no fields appear — run the workflow once or pin sample data in n8n, then refresh. You can still add free-form key/value pairs.

GET webhooks receive query parameters ​

If the Webhook node's HTTP method is GET (or HEAD), the Data object is sent as query parameters instead of a JSON body.

All Actions ​

This integration provides three actions mapped to n8n's production webhooks and public REST API.

ActionDescription
Trigger WorkflowTrigger a published n8n workflow by calling its production webhook
List ExecutionsList executions, optionally filtered by workflow and status, with cursor pagination
Get ExecutionRetrieve one execution by ID, optionally with its detailed run data

Action details ​

Trigger Workflow ​

Trigger a published n8n workflow by calling its production webhook, with optional payload data and extra headers.

Inputs

Display KeyExample InputDescriptionRestrictions
Workflow"My Workflow"The webhook-triggered workflow to run. Only workflows with a Webhook trigger node are listed.Required
Data
Optional
{"email":"user@example.com"}Data sent to the workflow webhook as JSON body (or query parameters for GET webhooks). Fields are pre-filled from the webhook's sample payload when available.Object
Headers
Optional
{"X-Auth":"secret"}Extra HTTP headers sent with the webhook call. Required when the Webhook node uses Header Auth.Object

Example output

json
{ "message": "Workflow was started" }

When the workflow ends with a Respond to Webhook node, the action returns that node's response body instead (parsed as JSON when possible).

Documentation of API endpoint that powers action: n8n docs – Webhook node

List Executions ​

List the executions of the connected n8n instance, optionally filtered by workflow and status, with cursor pagination.

Inputs

Display KeyExample InputDescriptionRestrictions
Workflow
Optional
"My Workflow"Filter executions to one workflow. Leave empty for all workflows.—
Status
Optional
"success"Filter executions by status.Valid: canceled, crashed, error, new, running, success, waiting
Limit
Optional
50Number of executions to return per page.1–250, default 50
Cursor
Optional
"MTIzNDU2"Pagination cursor — pass the nextCursor of the previous response to fetch the next page.String
Include Data
Optional
falseInclude each execution's detailed node-by-node run data. Heavy — leave off unless needed.Boolean

Example output

json
{
  "data": [
    {
      "id": "12345",
      "finished": true,
      "mode": "webhook",
      "status": "success",
      "startedAt": "2026-08-27T10:30:00.000Z",
      "stoppedAt": "2026-08-27T10:30:05.000Z",
      "workflowId": "6COFU25an3RavMvZ"
    }
  ],
  "nextCursor": null
}

Documentation of API endpoint that powers action: n8n API – Retrieve all executions (GET /executions)

Get Execution ​

Retrieve one n8n execution by ID, optionally with its detailed node-by-node run data.

Inputs

Display KeyExample InputDescriptionRestrictions
Execution ID"12345"The ID of the execution to retrieve — e.g. returned by a Respond to Webhook node that outputs the n8n expression {{ $execution.id }} (see example).Required
Include Data
Optional
falseInclude the execution's detailed node-by-node run data. Heavy — leave off unless needed.Boolean

Example output

json
{
  "id": "12345",
  "finished": true,
  "mode": "webhook",
  "status": "success",
  "startedAt": "2026-08-27T10:30:00.000Z",
  "stoppedAt": "2026-08-27T10:30:05.000Z",
  "workflowId": "6COFU25an3RavMvZ"
}

While an execution is still running, stoppedAt is null and finished is false.

Documentation of API endpoint that powers action: n8n API – Retrieve an execution (GET /executions/{id})

Error handling ​

Error code and typeReason
400 Bad RequestMissing/unconfigured instance URL, workflow has no Webhook trigger node, or a numeric offset used with cursor-only pagination.
401 UnauthorizedInvalid or missing API key — also returned on n8n Cloud free trials, which do not include the public API.
404 Not FoundWorkflow not found on the instance, or the workflow is not published (production webhooks only register once published) / the webhook path changed.

FAQs ​

Why doesn't my workflow appear in the Workflow dropdown?

Only workflows with a Webhook trigger node can be triggered from WeWeb, so the dropdown lists only those. Add a Webhook trigger node to the workflow in n8n, then refresh the dropdown.

How do I get the workflow's result instead of "Workflow was started"?

By default n8n's webhook responds immediately, before the workflow finishes. End your workflow with a Respond to Webhook node (and set the Webhook node's Respond option to Using Respond to Webhook node) — the action then returns that node's response body.

How do I know if a triggered workflow succeeded?

Have the workflow's Respond to Webhook node return the execution ID using the n8n expression {{ $execution.id }} (typed in n8n, not in WeWeb), then call Get Execution with that ID and check its status. While it's still running, finished is false and stoppedAt is null. Full walkthrough here.

How do I get the next page of executions?

Pass the nextCursor value from the previous response as the Cursor input. n8n uses cursor pagination, so you can't jump to an arbitrary page number.

Can I trigger a workflow that isn't active?

No — the production webhook only responds once the workflow is published in n8n. Triggering an unpublished workflow returns a 404.