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

# Triggers

> Trigger V-Run Python workflows manually, via HTTP API with an x-api-key, or on a cron schedule — with a copy-to-n8n HTTP node for one-click integration.

Every published workflow can be executed in three ways. You can enable any combination of triggers for a single workflow.

## Manual

Run a workflow directly from the editor by filling out the input form and clicking **Run**. This is useful during development and for one-off executions.

The form is auto-generated from the `inputs` section of your `config.yaml`. Required fields must be filled; optional fields use their default values if left empty.

## API

Trigger a workflow programmatically by sending an HTTP POST request to the execute endpoint. Enable the API trigger in the `config.yaml`:

```yaml theme={null}
triggers:
  api:
    enabled: true
```

Then call the endpoint with your workflow's API key:

```bash theme={null}
curl -X POST https://run.virtualityhub.com/api/workflows/{workflowId}/execute \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inputs": {"target_url": "https://example.com", "max_articles": 10}}'
```

The request body maps to the workflow's declared inputs. The response includes the execution status and outputs. API triggers always run the **latest commit** of the workflow.

<Note>
  Each workflow has its own API key, visible in the **API Trigger** tab of the editor. Keep this key secret — it authenticates requests to your workflow.
</Note>

See the [API reference](/api-reference/introduction) for full details.

## Schedule

Run workflows on a recurring schedule using cron expressions. Configure schedules in the `config.yaml`:

```yaml theme={null}
triggers:
  schedule:
    enabled: true
    cron: "0 9 * * *"
    timezone: "UTC"
    payload:
      target_url: "https://example.com"
      max_articles: 10
```

| Field      | Description                                                                                |
| ---------- | ------------------------------------------------------------------------------------------ |
| `cron`     | Standard cron expression (minute, hour, day of month, month, day of week).                 |
| `timezone` | IANA timezone for the schedule (e.g. `UTC`, `America/New_York`).                           |
| `payload`  | Input values to pass on each scheduled run. Required if your workflow has required inputs. |

Scheduled runs execute the latest commit. To pause a schedule, set `enabled: false` and commit the change.

## Choosing the right trigger

| Use case                                               | Recommended trigger |
| ------------------------------------------------------ | ------------------- |
| Development and debugging                              | Manual              |
| Integrating with your own backend or external services | API                 |
| Recurring automation (daily reports, hourly checks)    | Schedule            |
