Workflow Launch Logic & Tips for Developers
A quick guide to automating workflows via Captain Data’s API, covering workflow logic, parameters, and how to retrieve results efficiently.
This guide is designed for developers looking to automate workflows using the Captain Data API. It covers workflow logic, API integration, and tips for handling common challenges, ensuring seamless automation for your projects.
Automate tasks by processing data through a series of steps
Key points:
- Batch Processing: Workflows process data in batches for efficient handling of large datasets.
- Rate Limiting: API calls are rate-limited for safe execution.
- Webhooks: Webhooks provide real-time updates for tracking progress and ingesting results.
Launching Workflows via API
Step 1: Authenticate
Authenticate using your API key and Project UID.
Step 2: Configure Workflow
Define workflow parameters and inputs, and specify the workflow UID.
Example Payload:
Step 3: Launch
Execute the request and enjoy the results.
Retrieving Run Results
Use the Get a Run’s Results endpoint to fetch workflow results.
Example Request:
Sample Response:
Option 1. Using Webhooks for Workflow Results
Webhooks provide real-time updates on Run success or failure.
Example Flow:
- Receive webhook with
job_uid
- Use Get a Run Results to fetch data
Read more on how-to Create & Manage Webhooks.
Option 2. Polling Data
You can track a Run’s progress with the GET a Run endpoint.
Example Request:
The response includes:
error_message
A message to help debug issues and retry Runs.status
: Indicates the workflow’s progress or completion.
If you want to implement polling to access a Run’s results before the Run is fully finished read our article Polling Data.
Tips for Developers
- Handle Rate Limits: Retry with exponential backoff.
- Debug Efficiently: Store
job_uid
for traceability. - Explore Workflow Schema: Validate inputs/outputs via the API.
Workflows Schemas
Use the GET - Get Workflow Details endpoint to retrieve schema details.
This will give you, for each step of the flow:
- Input fields: Required input data for each step.
variations
: other accepted field names which are generally retro keys to ensure compatibility (they are also displayed underretro_variations
)regex
: the criteria the input must match withprimary
: if primary, the key is necessary for the step to runhelp
: the help sentence displayed on the platform or returned if your input schema is false
- Output schema: Data model returned by the Action.
- Parameters schema: Optional input parameters to control the Action’s behavior, e.g.
max_results