What Does This Endpoint Do?
This endpoint allows you to start a workflow execution by sending structured JSON data. The workflow processes this data according to the steps youβve defined in the WorqHat Workflow Builder, enabling automation based on your specific business logic.When to Use JSON Payload Triggers
Youβll find this endpoint useful when you need to:- Integrate with applications: Send data from your applications to trigger automated processes
- Respond to events: Start workflows when specific events occur in your systems
- Process structured data: Pass complex data structures for processing by AI and other workflow steps
- Customize workflow behavior: Dynamically control how workflows operate based on input parameters
- Connect third-party services: Use webhooks to trigger workflows from external platforms
How It Works
- You send a POST request with your JSON payload to the workflowβs unique endpoint
- The workflow processes the data according to the steps youβve defined
- You receive an immediate confirmation response with a tracking ID
- The workflow continues executing in the background
Prerequisites
Before triggering a workflow, youβll need:- A WorqHat account with workflow creation permissions
- An API key with appropriate permissions
- The workflow ID of the workflow you want to trigger
Request Parameters
The JSON data to send to the workflow. This can be any valid JSON object structure that your workflow is designed to process.Example: Customer data, order information, configuration settings, etc.
Your API key in the format:
Bearer YOUR_API_KEY
Must be set to
application/json
The unique identifier (UUID) of the workflow you want to trigger
Response Fields Explained
Indicates whether the workflow was successfully triggered
A human-readable message describing the result of the operation
A unique identifier for tracking this specific workflow execution. You can use this ID to query the status or results of the workflow later.
ISO 8601 timestamp indicating when the workflow was triggered
Additional data about the workflow execution
The initial status of the workflow, typically βstartedβ
Code Examples
Example 1: Customer Onboarding Workflow
This example shows how to trigger a workflow that processes new customer information.Example Response
Hereβs what a successful response looks like when triggering a workflow:Error Handling
When triggering workflows, itβs essential to implement proper error handling to ensure your application can gracefully handle failures.Common Error Scenarios
Authentication Errors
Authentication Errors
If your API key is invalid or missing, youβll receive a 401 Unauthorized response.
Workflow Not Found
Workflow Not Found
If the workflow ID doesnβt exist, youβll receive a 404 Not Found response.
Invalid Payload
Invalid Payload
If your JSON payload is malformed or doesnβt meet the workflowβs requirements, youβll receive a 400 Bad Request response.
Rate Limiting
Rate Limiting
If you exceed your API rate limits, youβll receive a 429 Too Many Requests response.
- Always store your API keys securely and never expose them in client-side code
- Consider what data youβre sending to workflows and ensure sensitive information is handled appropriately
- Use HTTPS for all API communications
Error Handling
Implement robust error handling to manage cases where:- The workflow trigger request fails
- The workflow ID is invalid
- The API key doesnβt have sufficient permissions
- The JSON payload is malformed
Payload Size Limits
Be mindful of payload size limits when sending data to workflows:- The maximum payload size is 10MB
- For larger datasets, consider using file uploads or breaking the data into smaller chunks