---
title: "Automation configuration reference"
description: "Trigger configuration, limits, and operator controls for Shiba automations."
---

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

# Automation configuration reference

For the dashboard recipe gallery, use [Automations](/docs/automations/). This reference is for operators configuring triggers or integrating another service.

## Trigger kinds

An automation supports up to 20 triggers. A matching trigger can request a run, subject to the automation's conditions and limits.

| Kind | Configuration |
| --- | --- |
| `schedule` | A five-field cron expression plus an optional IANA `timezone` (UTC when omitted). Firings have a five-minute minimum gap; missed ticks coalesce. It may also declare one HTTPS URL `watch`. |
| `github` | Configured GitHub events delivered through the verified webhook. |
| `slack` | Configured Slack message or burst conditions. |
| `webhook` | An authenticated request to `POST /api/automations/{id}/trigger`. |
| `manual` | A request from **Run now** or `POST /api/automations/{id}/run`. |

Create a record with `POST /api/automations`, using your installation's dashboard authentication. The recipe gallery exposes preset configurations rather than every field.

```json title="Example automation configuration"
{
  "id": "nightly-dep-audit",
  "prompt": "Audit dependencies for known vulnerabilities and report the checks run",
  "repoUrl": "https://github.com/org/web-app",
  "enabled": true,
  "triggers": [
    { "kind": "schedule", "cron": "0 2 * * *" }
  ]
}
```

The per-automation webhook secret is returned only when the automation is created. Send it in the `x-automation-secret` header. Query-string secrets are not accepted.

An automation with exactly one schedule trigger can change that trigger's future cadence with `PATCH /api/automations/{id}`:

```json title="Schedule edit"
{
  "schedule": { "cron": "30 9 * * 1-5", "timezone": "America/New_York" }
}
```

The update is validated before it is stored. It cannot add, remove, or change trigger kinds, does not execute the automation, and does not approve any queued or future run. The v1 project API accepts the equivalent `triggerKind: "schedule"` and `schedule` update for an existing schedule automation. Its structured schedule form accepts `daily`, `weekdays`, `weekly`, `monthly`, or an explicit `cron` mode, all evaluated in the supplied IANA timezone.

### URL watches

A schedule trigger can include `{ "kind": "url", "url": "https://…" }` as `watch`. The URL must be public HTTPS without userinfo credentials, a fragment, localhost and IP-literal hosts, redirects, or common credential-bearing query parameters such as `token` or `api_key`; query strings are redacted in model-visible text. At each due tick Shiba reads at most 16 KiB with a five-second timeout and exactly one immediate retry. The first successful read establishes a baseline and does not queue work. Later, only a changed SHA-256 output hash queues the normal approval request; unchanged output and failures are visible as the routine's last skip. Output included in the task is escaped, secret-scrubbed, truncated to the remaining task limit, and marked untrusted. The stored hash advances only after the approval request is queued, so a failed queue attempt can be retried. A durable overlap lease prevents concurrent checks for the same routine. A watched schedule cannot share one automation with another schedule trigger. Command and local script watches are not currently supported and must not be represented as arbitrary shell execution. This is structural: the watch evaluates in the Worker before any wake, a Worker cannot run shell commands, and probing inside a sandbox before approval would break the approval-first invariant. A command watch needs a trusted non-Worker executor (such as a paired local daemon) before it can be designed honestly.

### Signed inbound webhooks

Webhook routines also accept `POST /api/hooks/{id}`. Creation returns a separate `hookSecret` once; it is encrypted at rest using `MODEL_CREDENTIAL_KEY`. Without that key, secret creation and rotation fail closed. Existing routines can generate a secret using **Rotate secret** in Routines or `POST /api/automations/{id}/hook-secret`. **Revoke secret** (`DELETE` on the same path) immediately disables signed deliveries; rotation invalidates the previous secret. These management actions require dashboard authentication. Save the returned secret securely: it cannot be retrieved later.

Send `X-Shiba-Timestamp` (Unix seconds), `X-Shiba-Delivery-Id` (unique per event), and `X-Shiba-Signature: sha256=<hex>`. Compute HMAC-SHA256 with the secret string as the UTF-8 key over the exact UTF-8 body prefixed by `timestamp.deliveryId.`. Alternatively use Standard Webhooks: `webhook-id`, `webhook-timestamp`, and `webhook-signature` containing space-separated `v1,<base64>` signatures; sign `deliveryId.timestamp.body` with the base64-decoded bytes after `whsec_`.

Timestamps more than five minutes in either direction are rejected (401). Delivery IDs cannot contain dots. Bodies have a 32,000-byte transport cap, but the effective limit is **4,000 characters for the complete task**, including the routine prompt, selected skill snapshots, external-data delimiters and escaped payload. Oversized tasks return 413 before claiming a delivery receipt; XML escaping can expand the payload. A completed repeated delivery ID for the same routine returns `200` with `duplicate: true` for seven days, without requesting another run. An in-progress delivery returns retryable 409; abandoned pending claims can be retried after 60 seconds. Receipt storage requires the D1 migrations; unavailable storage returns 503. Retry failed deliveries with the same ID and a fresh timestamp/signature; queue command IDs remain stable across retries. Signed deliveries use the existing enabled, condition, budget and human-approval gates; payloads are marked untrusted external data, never tool or approval configuration. Signed deliveries do not use legacy webhook batching. `/api/trigger` and the legacy automation trigger endpoint are unchanged.

## Work targets and pinned instructions

The recipe gallery uses repository tasks. The API accepts an explicit `executionTarget` for either a repository or an artifact workspace:

- **Repository:** the target repository must match `repoUrl` when both are supplied.
- **Artifact workspace:** omit `repoUrl`; only schedule triggers are accepted. The run cannot request a pull request or connected-app mutations.
- **Connected app:** rejected until a permissioned automation adapter is available.

Custom employee schedules require a reviewed profile-version pin. Before dispatch, Shiba resolves the current employee profile and compares its version/hash; a changed or unavailable profile causes a recorded skip.

Attached reviewed skills are stored instruction snapshots. Dispatch checks each saved pin’s enabled flag and content hash, then uses those stored instructions. This is not a live lookup of the original skill library: editing or disabling a library skill does not automatically update or revoke the automation’s saved snapshot. Review and update the automation when those instructions should change.

## Conditional requests

A trigger can include a `runWhen` condition, such as “run for GitHub issues with the `bug` label.” For GitHub events, the condition can inspect the event name and action, repository, branch, author, and labels; issue titles and bodies are not included. The condition is evaluated before the coding-run approval is queued. With `TYPESAFE_API_KEY` configured, Shiba uses TypeSafe Noul; otherwise it uses the configured Workers AI planning model. Event/task context used for the check is sent to that service even though execution still needs human approval.

The condition fails closed: an error, empty answer, or unrecognized answer skips the request and records the reason. Model and platform usage can still incur charges.

## Approval and limits

Every automated run requires explicit human approval. A schedule or event does not grant permission to execute a task.

Legacy `unattended` and `unattendedRepos` fields remain readable for compatibility. They cannot approve a run or authorize an external mutation. Publishing completed changes requires a separate human approval of the frozen file snapshot.

| Control | Behavior |
| --- | --- |
| `dailyRunLimit` | Defaults to 20 requests per automation per UTC day. Further requests are refused with a reason. |
| Schedule floor | At least five minutes between firings. |
| Run concurrency | Dispatch uses the current orchestrator run registry: five active runs by default, or ten with `SHIBA_ELEVATED_CONCURRENCY`. This is separate from the deployment container ceiling. Excess requests can be refused rather than guaranteed to wait. |
| `enabled: false` | Disables an automation when stored in its configuration. |
| `AUTOMATIONS_ENABLED` | Deployment-wide switch; `false`, `0`, `off`, or `no` disables automation execution. |

These are application controls, not a guarantee of account capacity or price. Review [Costs](/docs/costs/) and your hosting account limits.

## Source and verification

Trigger matching and authorization live in `apps/backend/src/automations.ts`; requests are dispatched by `automation-runner.ts` and the `Automations` Durable Object. The dashboard recipe flow lives in `apps/frontend/src/components/AutomationsView.tsx`.

Implemented configuration and unit tests do not establish a working live integration. Use the [readiness checklist](/docs/readiness/) when validating your deployment.

Source: https://tryshiba.dev/docs/automation-reference/index.mdx
