> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Run background work

> Run tasks, workflows, jobs, and scheduled work.

Run background work when a task must continue outside a request path.

## Steps

1. Choose a task for one unit of work.
2. Use a workflow when work needs multiple ordered steps.
3. Create the task or workflow target.
4. Create a job to run the target.
5. Add a cron job when the work needs a schedule.
6. Track job status, logs, and events.

## Try it with REST

Create a task:

`POST /projects/{project_reference}/tasks`

```bash title="Terminal" theme={null}
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 title="Terminal" theme={null}
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
  }'
```

Run the task with a one-off job:

`POST /projects/{project_reference}/jobs`

```bash title="Terminal" theme={null}
curl -X POST https://api.veryfront.com/projects/support-assistant/jobs \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily summary",
    "target": "tasks/daily-summary"
  }'
```

Schedule the same target:

`POST /projects/{project_reference}/cron-jobs`

```bash title="Terminal" theme={null}
curl -X POST https://api.veryfront.com/projects/support-assistant/cron-jobs \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily summary schedule",
    "target": "tasks/daily-summary",
    "schedule": "0 9 * * *",
    "timezone": "UTC"
  }'
```

## API surfaces

| Surface | Start here                                                                                                                                                                                                                                                              |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| REST    | [Tasks](/cloud/rest/api-reference/tasks/create-task), [Workflows](/cloud/rest/api-reference/workflows/create-workflow), [Schedules](/cloud/rest/api-reference/schedules/create-project-schedule), [Runs](/cloud/rest/api-reference/runs/create-a-canonical-durable-run) |
| GraphQL | [Create Job](/cloud/graphql/operations/jobs/mutations/createjob), [Create Cron Job](/cloud/graphql/operations/jobs/mutations/createcronjob)                                                                                                                             |
| MCP     | [Create Task](/cloud/mcp/tools/create-task), [Create Workflow](/cloud/mcp/tools/create-workflow), [Create Job](/cloud/mcp/tools/create-job), [Create Cron Job](/cloud/mcp/tools/create-cron-job)                                                                        |

## Verify

List tasks and workflows for the project.

Confirm the created task and workflow exist.

List jobs and confirm the one-off job appears.

List cron jobs and confirm the schedule is active.

## Choose a target

| Target   | Use it for                               |
| -------- | ---------------------------------------- |
| Task     | One repeatable background operation.     |
| Workflow | Ordered multi-step automation.           |
| Job      | Durable execution of a task or workflow. |
| Cron job | Scheduled job creation.                  |
| Webhook  | External event ingress.                  |

## API reference

| API                       | Start here                                       |
| ------------------------- | ------------------------------------------------ |
| [REST](/cloud/rest)       | Tasks, workflows, jobs, cron jobs, and webhooks. |
| [GraphQL](/cloud/graphql) | Task, workflow, and job views.                   |
| [MCP](/cloud/mcp)         | Job and automation tools.                        |
