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

# Triggers

> Configure how your automations start — manually, from events, or on a schedule

## What are Triggers?

Triggers define how a composer's workflow is started. Each composer has a trigger type configured at the composer level. When a trigger fires, it passes contextual data into the workflow that you can access with `{{trigger.*}}` template variables.

## Project Selection

Every trigger can be scoped to a specific project. Open the trigger configuration panel and use the **Project** dropdown to choose which project this composer operates on.

When you select a project, two things happen automatically:

* The **Target Project** field on every [Review step](/automations/steps/review) in the composer is updated to match the selected project.
* If your organization has a variable named **RP Project ID**, its `id` key is automatically updated with the selected project's ID.

<Tip>
  Setting the project at the trigger level is the recommended way to keep all Review steps in sync — you only need to change one field and the rest updates automatically.
</Tip>

## Variable Sync

The trigger panel also lets you map a project code (e.g. `BEATCA251482`) to a specific key inside one of your [Variables](/automations/variables). This is useful when downstream steps or nested automations rely on a variable to know which project they're working with.

**To configure variable sync:**

<Steps>
  <Step title="Select a variable">
    In the **Sync to Variable** dropdown, choose the variable you want to keep in sync.
  </Step>

  <Step title="Select a key">
    The **Variable Key** dropdown appears and lists all keys inside that variable's content. Select the key that should hold the project code.
  </Step>

  <Step title="Enter the project code">
    Type the project code in the **Value** field (e.g. `BEATCA251482`) and press Enter or click away. The variable's key is updated immediately.
  </Step>
</Steps>

<Note>
  The variable sync fields use progressive disclosure — the key picker only appears after you select a variable, and the value field only appears after you select a key.
</Note>

## Trigger Types

### Manual

Run the workflow on demand using the **Run** button in the composer or canvas header. Manual triggers are useful for testing and for workflows that should only run when explicitly started.

### Event

Event triggers fire automatically when specific database events occur. The trigger data from the event is available as `{{trigger.*}}` in your steps.

**Available events:**

| Event            | Description                                 |
| ---------------- | ------------------------------------------- |
| Contract Created | Fires when a new contract is created        |
| Contract Updated | Fires when an existing contract is modified |
| Contract Deleted | Fires when a contract is removed            |

### Schedule

Schedule triggers run the workflow automatically based on a CRON expression.

**Common patterns:**

| CRON Expression | Schedule                 |
| --------------- | ------------------------ |
| `0 0 * * *`     | Daily at midnight        |
| `0 9 * * 1-5`   | Weekdays at 9 AM         |
| `0 */6 * * *`   | Every 6 hours            |
| `0 0 1 * *`     | First day of every month |
| `*/30 * * * *`  | Every 30 minutes         |

Enter the CRON expression in the trigger configuration panel of your composer.

### Webhook (Coming Soon)

Webhook triggers will allow external systems to start a workflow by sending an HTTP request to a unique URL. This enables integrations with third-party services that support outbound webhooks.

## Related Documentation

<CardGroup cols={2}>
  <Card title="Composers" icon="layers" href="/automations/composers">
    Triggers are configured at the composer level.
  </Card>

  <Card title="Steps" icon="puzzle" href="/automations/steps/overview">
    Use trigger data in your steps with template variables.
  </Card>

  <Card title="Test & Deploy" icon="rocket" href="/automations/test-and-deploy">
    Test your triggers before deploying to live.
  </Card>
</CardGroup>
