Skip to main content

Route

HTTP endpoints to access your workflows.

Written by Jamie Gaynor

Routes are HTTP endpoints on a workflow step to make your workflows accessible via the web. When a step includes a route field in its configuration, it acts as an entry point, allowing your workflow to receive and process external HTTP requests like webhooks, API calls, and web page requests.

How routes work

When an incoming request hits a defined route, the workflow triggers, using the request data as its input. You have full control over the response, allowing you to build everything from simple webhook listeners to interactive web applications.

Key components

  • Route path: The URL path that identifies your endpoint (e.g., /api/webhook).

  • HTTP method: The method used to interact with the route (GET, POST, PUT, DELETE, or PATCH).

  • Output: A setting that determines whether the result of your step is returned as an HTTP response to the caller.

Common route types

You can use routes to power a variety of integrations:

  • Webhook receivers: Ideal for listening to events from external services like GitHub or Slack. The workflow processes the data and returns a quick acknowledgment.

  • API endpoints: Create custom RESTful APIs. These are synchronous; the workflow processes the request and returns data directly to the caller.

  • Web pages: You can return HTML content from a step, effectively allowing you to serve simple web pages or interactive dashboards directly from your workflow.

  • Form handlers: Use routes to accept form submissions, process the data, and redirect users or show success messages.

Learn how to monitor the route types being used in your tenant here.

Troubleshooting common issues

  • 404 not found: Ensure your workflow is published to the main branch and that your HTTP method matches the route configuration.

  • 504 gateway timeout: If a response takes too long, your workflow may be hitting a timeout. For long-running operations, consider using an asynchronous pattern, return a "202 Accepted" response immediately and process the task in the background.

  • CORS errors: If your route is being accessed by a browser, ensure you have correctly configured your CORS headers to allow requests from your origin.

Did this answer your question?