Run background work

Start a task or workflow and track it after the initiating request ends. Add a schedule for recurring work.

Steps

  1. Choose a task for one operation or a workflow for coordinated steps.
  2. Create the target definition.
  3. Create a schedule for recurring execution, or start a run for one-off work.
  4. Inspect run status, output and events.

Try it with REST

Create a task:

POST /projects/{project_reference}/tasks

bash
curl -X POST https://api.veryfront.com/projects/support-assistant/tasks \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "daily-summary",
    "name": "Daily summary",
    "schedulable": true
  }'

Create a workflow:

POST /projects/{project_reference}/workflows

bash
curl -X POST https://api.veryfront.com/projects/support-assistant/workflows \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "support-triage",
    "description": "Classify new support requests and assign next steps.",
    "schedulable": true
  }'

Create a recurring schedule for the task:

POST /projects/{project_reference}/schedules

bash
curl -X POST https://api.veryfront.com/projects/support-assistant/schedules \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily summary",
    "target": {
      "kind": "task",
      "id": "daily-summary"
    },
    "schedule": "0 8 * * *",
    "timezone": "Etc/UTC",
    "concurrency_policy": "Forbid"
  }'

Start a one-off durable run. Set VERYFRONT_PROJECT_ID to the project's UUID first.

POST /runs

Use a new idempotency key for each logical run and reuse it when retrying that request.

bash
RUN_IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.veryfront.com/runs \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $RUN_IDEMPOTENCY_KEY" \
  -d "{
    \"project_id\": \"$VERYFRONT_PROJECT_ID\",
    \"target\": { \"type\": \"task\", \"id\": \"daily-summary\" }
  }"

Verify

Confirm the task and workflow appear in the project's lists and the schedule targets the intended definition. Inspect the run's final status and output. A failed or cancelled run is terminal, but the work has not succeeded.

Choose a target

TargetUse it for
TaskOne defined background operation.
WorkflowOrdered multi-step automation.
ScheduleRecurring execution of a task or workflow.
RunDurable execution with status and events.
WebhookExternal event ingress.

API reference