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

# nora triggers

> Manage Trigger blocks — API, webhook, and schedule entries into a Flow.

Triggers are how a Flow starts. Three kinds: `api` (called from an SDK/CLI), `webhook` (external HTTP POST), and `schedule` (cron-based).

## Commands

| Command                               | Description                            |
| ------------------------------------- | -------------------------------------- |
| `triggers create --kind <k>`          | Add a Trigger block.                   |
| `triggers update <trigger-id>`        | Patch fields (many `--set-*` flags).   |
| `triggers edit <trigger-id>`          | Open Trigger JSON in `$EDITOR`.        |
| `triggers delete <trigger-id>`        | Remove Trigger.                        |
| `triggers secret rotate <trigger-id>` | Mint a new webhook/API signing secret. |

## `triggers create`

```bash theme={null}
nora triggers create --kind webhook --name "customer-events"
```

Flags:

* `--kind` (required) — `api` / `webhook` / `schedule`.
* `--name <n>` — display name.
* `--config <json>` — inline config for the specific kind.
* `--x <n>`, `--y <n>` — canvas position.

The command prints the created Trigger's ID (and, for `webhook`/`api`, the initial secret — copy it now; it's shown only once).

## `triggers update`

```bash theme={null}
nora triggers update tr_events \
  --set-kind schedule \
  --set-schedule-mode preset \
  --set-period daily \
  --set-time 09:00 \
  --set-timezone Asia/Seoul
```

Update flags are large — grouped below.

### Update flags — grouped

**Identity**

* `--set-name <n>`
* `--set-kind api|webhook|schedule`
* `--set-x <n>`, `--set-y <n>`, `--set-width <n>`

**Schedule config** (kind = `schedule`)

* `--set-schedule-mode preset|cron`
* `--set-cron <expr>` — for mode = `cron`, e.g. `"0 9 * * *"`.
* `--set-period daily|weekly|monthly|yearly` — for mode = `preset`.
* `--set-time HH:MM` — for preset.
* `--set-day-of-week 1..7` — for weekly.
* `--set-day-of-month 1..31` — for monthly.
* `--set-month-of-year 1..12` — for yearly.
* `--set-interval <n>` — interval count.
* `--set-timezone <IANA>` — e.g. `America/Los_Angeles`.
* `--set-schedule-input <text>` — payload injected per scheduled run.
* `--set-schedule-thread-id <id>` — for chat Agents, thread to post into.
* `--set-schedule-user-id <id>` — user attribution.
* `--set-schedule-tts true|false` — treat as text-to-speech input.

**Webhook config** (kind = `webhook`)

* `--set-webhook-slug <s>` — path suffix (URL becomes `.../trigger/webhook/<slug>`).
* `--set-webhook-input-path <json-path>` — extract input from body.
* `--set-webhook-image-path <json-path>` — extract image data.
* `--set-webhook-audio-path <json-path>` — extract audio data.
* `--set-webhook-auth-kind <k>` — `none` / `secret` / `header`.
* `--set-webhook-auth-header <name>` — header name for `header` auth.

**API config** (kind = `api`)

* `--set-api-slug <s>` — path suffix.
* `--set-api-auth-kind <k>` — `none` / `secret` / `header`.
* `--set-api-auth-header <name>`.

**Bulk**

* `--patch <json>` — arbitrary merge.

Config patches deep-merge into the existing config.

## `triggers edit`

```bash theme={null}
nora triggers edit tr_events
```

Full JSON in `$EDITOR`. Save to apply.

## `triggers delete`

```bash theme={null}
nora triggers delete tr_events
```

## `triggers secret rotate`

```bash theme={null}
nora triggers secret rotate tr_events
```

Mints a new signing secret. Prints the plaintext once — copy it into your caller. The old secret continues to work for 60 minutes so you can update callers without downtime.

Rotate on schedule (quarterly is common), or immediately after suspected leak.

## Recipes

### Add a daily 9AM Seoul-time schedule

```bash theme={null}
TR=$(nora triggers create --kind schedule --name "daily-9am" | jq -r '.id')

nora triggers update $TR \
  --set-schedule-mode preset \
  --set-period daily \
  --set-time 09:00 \
  --set-timezone Asia/Seoul \
  --set-schedule-input "Daily rollup — summarize yesterday's tickets"
```

Publish the Flow — the schedule starts firing.

### Add a webhook trigger for a CMS

```bash theme={null}
TR=$(nora triggers create --kind webhook --name "cms-hook" | jq -r '.id')

nora triggers update $TR \
  --set-webhook-slug cms \
  --set-webhook-input-path payload.body \
  --set-webhook-auth-kind secret

nora triggers secret rotate $TR  # capture the secret
```

The webhook URL: `https://api.platform.nora.my/trigger/webhook/<flow-slug>/cms`. Configure the CMS to POST there with `X-Nora-Signature`.

### Convert a preset schedule to cron

```bash theme={null}
nora triggers update tr_daily \
  --set-schedule-mode cron \
  --set-cron "0 9 * * MON-FRI"    # weekdays 9AM
```

Cron is more expressive than preset — use for anything beyond daily/weekly/monthly patterns.

### Change the input path a webhook extracts

Old CMS shape: `{ "body": "..." }` — path was `body`.

New shape: `{ "message": { "body": "..." } }`:

```bash theme={null}
nora triggers update tr_cms --set-webhook-input-path message.body
```

Publish the Flow to make the change live.
