Workflow REST API
The Workflow REST API allows you to execute and manage workflows programmatically. You can run workflows synchronously (with wait) or asynchronously (as background jobs).
Authentication
All API requests require:
- API key (x-api-key header)
- Workflow endpoint (x-wf-endpoint header)
To obtain an API key, visit your AgentifyMe API Keys.
Rate Limits
- Synchronous requests: 100 requests per minute
- Asynchronous requests: 1000 requests per minute
- Result retrievals: 500 requests per minute
API Endpoints
Run a Workflow (Synchronous)
Executes a workflow and waits for the result.
bashcurl -X POST https://run.agentifyme.ai/v1/workflows/run \
-H 'x-api-key: <your-api-key>' \
-H 'x-wf-endpoint: <your-workflow-endpoint>' \
-H 'Content-Type: application/json' \
-d '{"name": "say-hello", "parameters": {"name": "AgentifyMe"}}'
Request Body:
json{
"name": "string", // Required: Workflow name
"parameters": object // Optional: Workflow parameters
}
Response (200 OK):
json{
"result": object, // Workflow execution result
"executionTime": number // Execution time in milliseconds
}
Run a Workflow (Asynchronous)
Starts a workflow as a background job and returns immediately.
bashcurl -X POST https://run.agentifyme.ai/v1/workflows/jobs \
-H 'x-api-key: <your-api-key>' \
-H 'x-wf-endpoint: <your-workflow-endpoint>' \
-H 'Content-Type: application/json' \
-d '{"name": "say-hello", "parameters": {"name": "AgentifyMe"}}'
Response (202 Accepted):
json{
"jobId": "string", // Use this to retrieve results
"status": "pending"
}
Retrieve Workflow Results
Get results of an asynchronous workflow execution.
bashcurl -X GET https://run.agentifyme.ai/v1/workflows/jobs/<job-id> \
-H 'x-api-key: <your-api-key>' \
-H 'x-wf-endpoint: <your-workflow-endpoint>'
Response (200 OK):
json{
"jobId": "string",
"status": "completed" | "failed" | "pending",
"result": object, // Present if status is "completed"
"error": string, // Present if status is "failed"
"executionTime": number
}
Error Handling
The API uses standard HTTP status codes:
- 200: Success
- 202: Accepted (async job started)
- 400: Bad Request (invalid parameters)
- 401: Unauthorized (invalid API key)
- 404: Not Found (invalid workflow or job ID)
- 429: Too Many Requests (rate limit exceeded)
- 500: Internal Server Error
Error responses include:
json{
"error": "Error message",
"code": "ERROR_CODE",
"details": object
}
Best Practices
- Use asynchronous execution for long-running workflows
- Implement exponential backoff for rate limit handling
- Store job IDs for result retrieval
- Set appropriate timeouts in your client code
For detailed examples and use cases, visit our API documentation.