Use the API
Trigger workflows programmatically using ORQO's API endpoints. This allows external systems, scripts, and CI/CD pipelines to start workflow runs and receive results.
Prerequisites
- A fully configured workflow ready to run
- API access to your ORQO instance
Steps
1. Understand the API architecture
ORQO exposes a REST API for programmatic interaction. The primary use case is triggering workflow runs from external systems:
External System → POST /api/v1/webhooks/:app_id → ORQO → Workflow Run
Webhook-based triggering uses the same inbound webhook infrastructure as app integrations, making it a consistent entry point for all external events.
2. Create an API app
If you do not already have an app for API access, create one:
- Navigate to Settings > Apps
- Click New App
- Name it "API" or "External Trigger"
- Set capabilities to Receive
- Leave the adapter URL blank (uses DirectAdapter)
- Save the app
This creates a dedicated webhook endpoint for API calls.
3. Get the webhook endpoint
Your API endpoint is:
POST https://your-orqo-domain.com/api/v1/webhooks/:app_id
Replace :app_id with the ID shown on the app card.
4. Trigger a workflow run
Send a POST request to the webhook endpoint with a JSON payload:
curl -X POST https://your-orqo-domain.com/api/v1/webhooks/42 \
-H "Content-Type: application/json" \
-d '{
"workflow_id": 15,
"task": "Research the latest trends in AI agent frameworks",
"metadata": {
"source": "ci-pipeline",
"ref": "main"
}
}'
| Field | Required | Description |
|---|---|---|
workflow_id | Yes | The workflow to execute |
task | No | Task description passed to the first stage |
metadata | No | Arbitrary JSON stored with the run for tracing |
5. Handle the response
A successful trigger returns a 200 OK with the created run's details:
{
"run_id": 238,
"status": "pending",
"workflow_id": 15,
"started_at": null
}
The run starts asynchronously. Use the run ID to check status later.
Workflow runs execute asynchronously. The API returns immediately after creating the run -- it does not wait for the workflow to complete.
6. Check run status
Query the run status by expanding the workflow's Runs & Triggers tab in the UI, or use the debug tools:
bin/rails "debug:run[238]"
This shows the run's current status, session ID, and timing information.
7. Secure your webhook endpoint
For production use, configure signature verification on the API app to prevent unauthorized triggers:
- Add a signing secret to the app's credentials or config
- Configure the receive config with the signature header and algorithm
- Sign your API requests with HMAC using the shared secret
# Generate HMAC signature
SIGNATURE=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET" | cut -d' ' -f2)
curl -X POST https://your-orqo-domain.com/api/v1/webhooks/42 \
-H "Content-Type: application/json" \
-H "X-Signature-256: sha256=$SIGNATURE" \
-d "$PAYLOAD"
Always use signature verification in production. Without it, anyone who discovers your webhook URL can trigger workflow runs.
8. Common integration patterns
CI/CD pipeline: Trigger a review workflow after each deployment to analyze code changes and generate reports.
Scheduled external job: Use an external scheduler (cron, Airflow, GitHub Actions) to trigger ORQO workflows with specific parameters.
Chained workflows: One workflow's output triggers another workflow via the API, creating a pipeline of independent workflows.
Form submission: A web form posts to the webhook endpoint, triggering a workflow that processes the submission (e.g., customer onboarding, support ticket triage).
9. Debug API issues
If your API calls are not triggering runs:
| Symptom | Check |
|---|---|
| 404 response | Verify the app ID in the URL is correct |
| 401/403 response | Check signature verification config |
| Run created but fails immediately | Check workflow configuration (missing LLM, agents, credentials) |
| No response | Verify ORQO is reachable and the URL is correct |
What's next
- Configure Webhooks for detailed webhook setup
- Monitor Runs to track API-triggered runs
- Set Up an App for full platform integrations