Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / n8n

n8n

n8n Public API: list and inspect workflows, publish (activate) or deactivate them, review executions, and list credential names and tags on your n8n Cloud or self-hosted instance.

8 actions API key 6 read2 write Calls app.n8n.cloud

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "n8n" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Activate workflowwriten8n.activate_workflowActivate (publish) a workflow so its triggers start running. Newer n8n versions label this endpoint deprecated in favour of publish but still serve it.
InputTypeDescription
workflow_idstringRequiredWorkflow id
TypeScript
await setu.execute({
  userId: "user_1",
  action: "n8n.activate_workflow",
  input: {
    "workflow_id": "<workflow_id>"
  },
});
Deactivate workflowwriten8n.deactivate_workflowDeactivate a workflow so its triggers stop running.
InputTypeDescription
workflow_idstringRequiredWorkflow id
TypeScript
await setu.execute({
  userId: "user_1",
  action: "n8n.deactivate_workflow",
  input: {
    "workflow_id": "<workflow_id>"
  },
});
Get executionreadn8n.get_executionGet one execution by id: status, timing and, if requested, the full data of every node.
InputTypeDescription
execution_idintegerRequiredExecution id
include_databooleanOptionalInclude the detailed run data (can be large)
TypeScript
await setu.execute({
  userId: "user_1",
  action: "n8n.get_execution",
  input: {
    "execution_id": 1
  },
});
Get workflowreadn8n.get_workflowGet one workflow in full: its nodes, connections, settings and tags.
InputTypeDescription
workflow_idstringRequiredWorkflow id
TypeScript
await setu.execute({
  userId: "user_1",
  action: "n8n.get_workflow",
  input: {
    "workflow_id": "<workflow_id>"
  },
});
List credentialsreadn8n.list_credentialsList credential names, types and ids (never the secrets). Only available to the instance owner or an admin.
InputTypeDescription
limitintegerOptionalMaximum items per page
cursorstringOptionalCursor from a previous page's next_cursor
TypeScript
await setu.execute({
  userId: "user_1",
  action: "n8n.list_credentials",
  input: {},
});
List executionsreadn8n.list_executionsList workflow runs, newest first, filtered by workflow or status (error, success, running, waiting, ...). Does not include run data.
InputTypeDescription
workflow_idstringOptionalOnly executions of this workflow
statusstringOptionalOnly executions with this status
started_afterstringOptionalOnly runs started after this ISO 8601 time
limitintegerOptionalMaximum items per page
cursorstringOptionalCursor from a previous page's next_cursor
TypeScript
await setu.execute({
  userId: "user_1",
  action: "n8n.list_executions",
  input: {},
});
List tagsreadn8n.list_tagsList the tags used to organise workflows.
InputTypeDescription
limitintegerOptionalMaximum items per page
cursorstringOptionalCursor from a previous page's next_cursor
TypeScript
await setu.execute({
  userId: "user_1",
  action: "n8n.list_tags",
  input: {},
});
List workflowsreadn8n.list_workflowsList workflows on the n8n instance with their ids, names and active state; filter by name, active flag or tag.
InputTypeDescription
activebooleanOptionalOnly active (true) or inactive (false) workflows
namestringOptionalFilter by workflow name
tagsstringOptionalComma-separated tag names
limitintegerOptionalMaximum items per page
cursorstringOptionalCursor from a previous page's next_cursor
TypeScript
await setu.execute({
  userId: "user_1",
  action: "n8n.list_workflows",
  input: {},
});