Skip to main content
Triggers let you schedule browser automation tasks that execute automatically on a recurring basis. Each trigger is tied to an environment, so it inherits the browser profile, stored cookies, and persistent files — no re-authentication required between runs.

Why Triggers

Without triggersWith triggers
You trigger every task manually via API callTasks run automatically on your chosen schedule
You build and maintain your own schedulerScheduling, retries, and failure handling are built in
Missed runs require manual interventionThe system tracks run history and pauses after repeated failures
Webhook delivery requires custom wiring per taskDelivery mode (webhook, bot, or both) is configured once per trigger

How It Works

  1. Create a trigger linked to an environment, with a schedule and task details.
  2. The system executes your task at each scheduled time using the environment’s browser profile and files.
  3. Results are delivered via webhook, bot notification, or both — depending on your deliveryMode setting.
  4. Run history is recorded for every execution so you can audit outcomes and debug failures.
Create trigger → System runs on schedule → Results delivered → Run history logged

Schedule Types

Every trigger requires a scheduleType that determines when and how often it runs.
TypeFieldDescriptionExample
atscheduleAtRun once at a specific date/time (ISO 8601)"2026-03-01T09:00:00Z"
everyscheduleIntervalRun at a fixed interval"30m", "2h", "1d"
cronscheduleCronStandard cron expression for full scheduling control"0 9 * * 1-5" (weekdays at 9 AM)
All schedules respect the timezone field (defaults to UTC).
Use scheduleType: "cron" with a standard cron expression for maximum flexibility — for example, "0 */6 * * *" runs every 6 hours, and "30 8 1 * *" runs at 8:30 AM on the first of each month.

Delivery Modes

Control how run results are delivered using the deliveryMode field.
ModeDescription
webhookResults are sent to your configured webhook endpoint
botResults are delivered via bot notification
bothResults are sent to both webhook and bot
When deliveryMode is webhook or both, you must provide a webhook configuration object. See Webhooks for details on webhook parameters.

Automation Policy

Triggers can optionally be associated with an automation policy. Policies define rules that govern agent behavior during execution — such as domain restrictions, blocked keywords, action type controls, and capability limits. When a policy is assigned, the browser agent will enforce those rules for every run of the trigger. This is useful for compliance, safety guardrails, or scoping what the agent is allowed to do. To assign a policy, pass the policyId field when creating or updating a trigger, or select one from the “Automation Policy” dropdown in the dashboard.

Trigger Statuses

StatusMeaning
activeTrigger is running on schedule
pausedTrigger is paused and will not execute until resumed
A trigger is automatically paused after reaching maxConsecutiveFailures (default: 5). Resume it with the resume endpoint after resolving the issue.

Authentication

All endpoints require an API key in the Authorization header:
Authorization: Bearer <api_key>

Base URL

https://connect.webrun.ai

List Triggers

Returns all triggers for the authenticated user, sorted by creation date (newest first).
GET /cron-jobs
curl https://connect.webrun.ai/cron-jobs \
  -H "Authorization: Bearer enig_xxx"
Response:
{
  "success": true,
  "cronJobs": [
    {
      "_id": "664a1b2c3d4e5f6a7b8c9d0e",
      "userId": "67f1a2b3c4d5e6f7a8b9c0d1",
      "environmentId": "683a1f2e4b0c1d2e3f4a5b6c",
      "policyId": null,
      "name": "Daily price check",
      "description": "Check competitor prices every morning",
      "scheduleType": "cron",
      "scheduleCron": "0 9 * * *",
      "timezone": "America/New_York",
      "taskDetails": "Go to competitor.com/pricing and extract all plan prices",
      "outputType": "structured",
      "deliveryMode": "webhook",
      "status": "active",
      "nextRunAt": "2026-02-25T14:00:00.000Z",
      "consecutiveFailures": 0,
      "createdAt": "2026-02-20T10:00:00.000Z"
    }
  ]
}

Create a Trigger

POST /cron-jobs
Content-Type: application/json

Request Body

FieldTypeRequiredDescription
namestringYesTrigger name
descriptionstringNoOptional description
environmentIdstringYesID of the environment to use
scheduleTypestringYes"at", "every", or "cron"
scheduleAtstringConditionalISO 8601 datetime (required when scheduleType is "at")
scheduleIntervalstringConditionalInterval string like "30m", "2h" (required when scheduleType is "every")
scheduleCronstringConditionalCron expression (required when scheduleType is "cron")
timezonestringNoIANA timezone (default: "UTC")
taskDetailsstringYesInstructions for the browser automation task
startingUrlstringNoURL where the task should begin
outputTypestringNo"text" (default) or "structured"
outputSchemaobjectNoJSON Schema for structured output (when outputType is "structured")
deliveryModestringNo"webhook", "bot", or "both" (default: "webhook")
webhookobjectConditionalWebhook config (required when deliveryMode includes "webhook")
retryPolicyobjectNoCustom retry configuration
policyIdstringNoID of an automation policy to apply to this trigger’s executions. When set, the browser agent will follow the policy’s rules (domain restrictions, keyword blocking, capability controls, etc.)
maxConsecutiveFailuresnumberNoFailures before auto-pause (default: 5)

Example: Recurring Cron Schedule

curl -X POST https://connect.webrun.ai/cron-jobs \
  -H "Authorization: Bearer enig_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily price check",
    "description": "Check competitor prices every morning",
    "environmentId": "<ENV_ID>",
    "policyId": "665a1f...abc",
    "scheduleType": "cron",
    "scheduleCron": "0 9 * * 1-5",
    "timezone": "America/New_York",
    "taskDetails": "Go to competitor.com/pricing and extract all plan prices",
    "startingUrl": "https://competitor.com/pricing",
    "outputType": "structured",
    "outputSchema": {
      "type": "object",
      "properties": {
        "plans": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "price": { "type": "number" }
            }
          }
        }
      }
    },
    "deliveryMode": "webhook",
    "webhook": {
      "name": "Price Updates",
      "url": "https://api.yoursite.com/webhooks/prices",
      "auth": "Bearer your-secret-token",
      "submittedData": "ai_response"
    }
  }'

Example: Fixed Interval

curl -X POST https://connect.webrun.ai/cron-jobs \
  -H "Authorization: Bearer enig_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Inventory monitor",
    "environmentId": "<ENV_ID>",
    "policyId": null,
    "scheduleType": "every",
    "scheduleInterval": "2h",
    "taskDetails": "Check the inventory page and report any out-of-stock items",
    "startingUrl": "https://store.example.com/inventory",
    "deliveryMode": "webhook",
    "webhook": {
      "name": "Inventory Alert",
      "url": "https://api.yoursite.com/webhooks/inventory",
      "submittedData": "ai_response"
    }
  }'

Example: One-Time Scheduled Run

curl -X POST https://connect.webrun.ai/cron-jobs \
  -H "Authorization: Bearer enig_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Q1 report export",
    "environmentId": "<ENV_ID>",
    "scheduleType": "at",
    "scheduleAt": "2026-04-01T06:00:00Z",
    "taskDetails": "Log into the dashboard and export the Q1 revenue report as PDF",
    "deliveryMode": "bot"
  }'
Response (201 Created):
{
  "success": true,
  "cronJob": {
    "_id": "664a1b2c3d4e5f6a7b8c9d0e",
    "name": "Daily price check",
    "environmentId": "683a1f2e4b0c1d2e3f4a5b6c",
    "policyId": "665a1f...abc",
    "scheduleType": "cron",
    "scheduleCron": "0 9 * * 1-5",
    "timezone": "America/New_York",
    "taskDetails": "Go to competitor.com/pricing and extract all plan prices",
    "status": "active",
    "nextRunAt": "2026-02-25T14:00:00.000Z",
    "createdAt": "2026-02-24T10:00:00.000Z"
  }
}

Errors

StatusMessageCause
400name is requiredMissing or empty name
400taskDetails is requiredMissing or empty taskDetails
400Valid environmentId is requiredMissing or invalid environment ID
400Maximum of N cron jobs per userUser limit reached
400webhook config is required when deliveryMode includes webhookMissing webhook config
404Environment not foundEnvironment does not exist or belongs to another user

Get a Trigger

Returns a single trigger with its 10 most recent runs.
GET /cron-jobs/:id
curl https://connect.webrun.ai/cron-jobs/<JOB_ID> \
  -H "Authorization: Bearer enig_xxx"
Response:
{
  "success": true,
  "cronJob": {
    "_id": "664a1b2c3d4e5f6a7b8c9d0e",
    "name": "Daily price check",
    "status": "active",
    "nextRunAt": "2026-02-25T14:00:00.000Z",
    "consecutiveFailures": 0
  },
  "recentRuns": [
    {
      "_id": "run_abc123",
      "cronJobId": "664a1b2c3d4e5f6a7b8c9d0e",
      "status": "completed",
      "createdAt": "2026-02-24T14:00:00.000Z"
    }
  ]
}

Errors

StatusMessageCause
404Cron job not foundInvalid ID or job belongs to another user

Update a Trigger

Update any field on an existing trigger. Only include the fields you want to change.
PUT /cron-jobs/:id
Content-Type: application/json
curl -X PUT https://connect.webrun.ai/cron-jobs/<JOB_ID> \
  -H "Authorization: Bearer enig_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "scheduleCron": "0 8 * * 1-5",
    "timezone": "Europe/London"
  }'
Response:
{
  "success": true,
  "cronJob": {
    "_id": "664a1b2c3d4e5f6a7b8c9d0e",
    "name": "Daily price check",
    "scheduleCron": "0 8 * * 1-5",
    "timezone": "Europe/London",
    "nextRunAt": "2026-02-25T08:00:00.000Z"
  }
}
Changing schedule-related fields (scheduleType, scheduleAt, scheduleInterval, scheduleCron, timezone) automatically recomputes nextRunAt.

Errors

StatusMessageCause
404Cron job not foundInvalid ID or job belongs to another user

Delete a Trigger

Permanently deletes a trigger and all its run history.
DELETE /cron-jobs/:id
curl -X DELETE https://connect.webrun.ai/cron-jobs/<JOB_ID> \
  -H "Authorization: Bearer enig_xxx"
Response:
{
  "success": true,
  "message": "Cron job deleted"
}

Errors

StatusMessageCause
404Cron job not foundInvalid ID or job belongs to another user

Pause a Trigger

Pause an active trigger. The trigger will stop executing until resumed.
POST /cron-jobs/:id/pause
curl -X POST https://connect.webrun.ai/cron-jobs/<JOB_ID>/pause \
  -H "Authorization: Bearer enig_xxx"
Response:
{
  "success": true,
  "cronJob": {
    "_id": "664a1b2c3d4e5f6a7b8c9d0e",
    "status": "paused"
  }
}

Errors

StatusMessageCause
400Cannot pause a job with status “paused”Job is not currently active
404Cron job not foundInvalid ID or job belongs to another user

Resume a Trigger

Resume a paused trigger. Resets the consecutive failure counter and recomputes the next run time.
POST /cron-jobs/:id/resume
curl -X POST https://connect.webrun.ai/cron-jobs/<JOB_ID>/resume \
  -H "Authorization: Bearer enig_xxx"
Response:
{
  "success": true,
  "cronJob": {
    "_id": "664a1b2c3d4e5f6a7b8c9d0e",
    "status": "active",
    "consecutiveFailures": 0,
    "nextRunAt": "2026-02-25T14:00:00.000Z"
  }
}

Errors

StatusMessageCause
400Cannot resume a job with status “active”Job is not currently paused
404Cron job not foundInvalid ID or job belongs to another user

Run a Trigger Manually

Immediately run a trigger outside of its normal schedule. The run executes in the background.
POST /cron-jobs/:id/trigger
curl -X POST https://connect.webrun.ai/cron-jobs/<JOB_ID>/trigger \
  -H "Authorization: Bearer enig_xxx"
Response:
{
  "success": true,
  "message": "Job triggered. Check runs endpoint for results."
}
Manual triggers run independently of the trigger’s schedule. The trigger’s nextRunAt is not affected.

Errors

StatusMessageCause
404Cron job not foundInvalid ID or job belongs to another user

List Trigger Runs

Returns paginated execution history for a trigger.
GET /cron-jobs/:id/runs
ParameterLocationDefaultDescription
pageQuery1Page number
limitQuery20Results per page (max 50)
curl "https://connect.webrun.ai/cron-jobs/<JOB_ID>/runs?page=1&limit=10" \
  -H "Authorization: Bearer enig_xxx"
Response:
{
  "success": true,
  "runs": [
    {
      "_id": "run_abc123",
      "cronJobId": "664a1b2c3d4e5f6a7b8c9d0e",
      "status": "completed",
      "createdAt": "2026-02-24T14:00:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 45,
    "totalPages": 5
  }
}

Get a Specific Run

Returns details for a single run.
GET /cron-jobs/:id/runs/:runId
curl https://connect.webrun.ai/cron-jobs/<JOB_ID>/runs/<RUN_ID> \
  -H "Authorization: Bearer enig_xxx"
Response:
{
  "success": true,
  "run": {
    "_id": "run_abc123",
    "cronJobId": "664a1b2c3d4e5f6a7b8c9d0e",
    "status": "completed",
    "createdAt": "2026-02-24T14:00:00.000Z"
  }
}

Errors

StatusMessageCause
404Cron job not foundInvalid job ID or job belongs to another user
404Run not foundInvalid run ID or run does not belong to this job

Common Errors

All error responses follow this format:
{
  "success": false,
  "message": "Description of the error"
}
StatusMessageCause
401API key requiredMissing Authorization header
401Invalid or revoked API keyAPI key is incorrect or has been revoked
403Account is deactivatedUser account is disabled
500Server errorUnexpected server-side failure