Get Your API Key

To use the Leap Workflows API, you’ll need an API key. You can get one by signing up for a free account at app.tryleap.ai.

Running a Workflow via the API

Before you can run a workflow via the API, you’ll need to publish it first:

  1. Create and test your workflow in the Leap Workflows Builder
  2. Click the “Publish” button in the top right corner
  3. Your workflow is now ready to be called via the API

After publishing your workflow you’ll need to retrieve the workflow_id and the trigger_id you want to use.

Here’s a quick example of how you can publish and retrieve these values:

API Endpoints

Get started with these key endpoints:

Understanding the API Flow

When running a workflow through the API, it follows an asynchronous pattern:

  1. First, you call the Run Workflow endpoint which immediately returns a workflow run id. The workflow execution happens asynchronously in the background.

  2. Then, you use the Get Workflow Run endpoint using the id returned from the Run Workflow endpoint to check on the status and retrieve the results. A common pattern is to poll this endpoint every few seconds until the workflow run is complete.

Here’s a typical flow:

  1. Call /v2/runs with your workflow configuration
  2. Receive a workflow run id immediately
  3. Poll /v2/runs/{workflow_run_id} periodically to check status and get results
  4. Once the status indicates completion, retrieve your workflow output

This asynchronous approach allows you to handle long-running workflows efficiently without keeping connections open for extended periods.