Skip to main content
Webhooks enable you to trigger Cordage workflows via HTTP API, making it easy to integrate AI workflows into your applications, automation pipelines, or external services.

Overview

A webhook exposes your workflow as an API endpoint:

Setting Up Webhooks

1. Add a Webhook Node

  1. Drag a Webhook node onto your canvas
  2. Position it as the entry point of your workflow
  3. A unique webhook key is automatically generated

2. Configure Inputs

The Webhook node can receive input parameters: Map webhook inputs to downstream node parameters.

3. Connect to Export

Ensure your workflow ends with an Export node: The Export node’s output URLs are returned in the API response.

API Authentication

All webhook API calls require authentication:

Getting an API Key

  1. Go to Workspace Settings
  2. Navigate to API Keys
  3. Click Create API Key
  4. Copy and store securely (shown only once)
API keys are workspace-scoped. Keep them secret and never expose in client-side code.

API Endpoints

Trigger Workflow

Start a workflow run:
Request:
Response:

Get Run Status

Check execution progress:
Response (running):
Response (completed):

List Runs

Get recent workflow runs:

Cancel Run

Stop a running workflow:

Polling Pattern

Since workflows execute asynchronously, poll for completion:

Rate Limits

Rate limit headers are included in responses:

Error Handling

HTTP Status Codes

Error Response Format

Integration Examples

Node.js / JavaScript

Zapier / Make / n8n

  1. Use HTTP/Webhook module
  2. Configure POST request to trigger endpoint
  3. Add polling loop to check status
  4. Use output URLs in downstream steps

Serverless Functions

Best Practices

Use exponential backoff - When polling, increase delay between requests if the workflow is taking long.
Handle all status values - Check for “failed” and “cancelled” in addition to “completed”.
Store run IDs - Keep track of run IDs to check status later or for debugging.
Validate inputs - Check inputs before triggering to avoid wasting credits on invalid requests.
Use webhook callbacks - For long-running workflows, consider implementing callback URLs instead of polling (coming soon).

Debugging

Check Webhook Status

Verify your webhook is active in the Cordage UI:
  1. Open your canvas
  2. Click the Webhook node
  3. Check “Active” status in inspector

View Run History

See all runs for a webhook:
  1. Click the Webhook node
  2. Open “Run History” in inspector
  3. Click individual runs for details

Test Locally

Use curl or Postman to test your webhook: