Skip to main content

Programmatic, On-Demand Workflow Trigger

How to set a workflow trigger via Sylvan Lab's API

Sylvan Team avatar
Written by Sylvan Team
Updated today

Sylvan Labs allows you to trigger workflows on demand without defining a sample frequency when configuring the workflow's trigger.

To enable programmatic triggering, navigate to the Workflow Trigger section and choose the "On Demand" option under "Choose Sampling Frequency" (see image below).
​

Once set to "On Demand," workflows can only be triggered via API.

Triggering Workflows via API

For automation, users must trigger workflows programmatically using the Sylvan API. Below is the API documentation for triggering workflows by ID.

Endpoint

POST https://api-v1.hirupert.com/api/v1/alerts/{alert_id}/runs

Request Details

  • Host: api-v1.hirupert.com

  • Authorization: Users need to contact us to obtain an API key.

  • Path Parameter: {alert_id} – The unique ID of the workflow, which can be found in the URL when opening a workflow in the web app.

    Example: If the alert URL is https://my_company.hirupert.com/webapp/alert/1359, then the workflow (alert) ID is 1359.

Headers

{     "Authorization": "Bearer YOUR_API_KEY",     "Content-Type": "application/json" }

Response Codes and Messages

Success Response (200 OK)

If the workflow is successfully triggered, the API returns:

{     "status": "success" }

Error Responses

Status Code

Error Message

Reason

400 Bad Request

{ "detail": { "title": "Failed to trigger alert - Bad Request", "message": "Alert is paused" } }

The workflow is paused and cannot be triggered.

400 Bad Request

{ "detail": { "title": "Failed to trigger alert - Bad Request", "message": "Alert is scheduled to run within the next 15 minutes" } }

The workflow was triggered recently and is scheduled to run soon.

404 Not Found

{ "detail": { "title": "Failed to trigger alert - Not Found" } }

The workflow does not exist or has been deleted.

Use Case: Running Workflows After Data Updates

This API is particularly useful for triggering workflows right after ETL jobs or data syncs complete. Automating workflow execution ensures that reports and notifications reflect the latest data.

For any issues or to request API access, please contact our support team.

Did this answer your question?