Skip to main content

Tutorials / Run a workflow from the API

Tutorial

Run a workflow from the API

Intermediate6 min

Call a saved workflow from code, Zapier, Make, or n8n. Start with polling, then switch to webhooks when the run needs to feed another system.

Before you start

Estimated time: 6 min

  • A paid LLMWeave plan
  • A saved workflow in The Loom
  • An API key with workflows:read and workflow_runs:create scopes

Create a scoped API key

2 min

Open Settings, create an API key, and copy it when it is shown. For most scripts, grant workflows:read and workflow_runs:create. Add webhooks:manage only if you are creating standing webhook subscriptions.

Find the workflow id

1 min

Use GET /api/v1/workflows to list the workflows your key can run, or copy the id from the workflow URL in The Loom. If your key has a workflow allowlist, only those workflows are visible.

Trigger the run

3 to 5 min

POST to /api/v1/workflows/{workflow_id}/runs with input_text. If the workflow declares params, fetch GET /api/v1/workflows/{workflow_id} first and send a params object using the returned select, number, text, and boolean definitions.

Send an Idempotency-Key header, such as a UUID, so a network retry does not start the same workflow twice.

Poll or use a webhook

5 to 10 min

For a simple script, poll GET /api/v1/workflow-runs/{run_id} every few seconds until status is completed, failed, cancelled, or awaiting_input.

For Zapier, Make, n8n, or your own queue, pass webhook_url when creating the run, or create a standing webhook subscription. Webhook payloads are signed, and the API reference at /docs/api has copy-paste verification snippets.

Handle human review pauses

2 min

If status is awaiting_input, the workflow is paused for a human-review step. Send the reviewer to the app link from the API response or webhook payload. The v1 API does not have an approve/resume endpoint yet.

Keep going

Try it yourself

Put this pattern to work on your own task.

Create a weave