Slack Next-Gen Scheduled Trigger Provisioning Prompt
Provision and manage scheduled triggers for next-gen platform workflows via the Slack CLI and workflows.triggers.create so a recurring ops workflow (digest, sweep, reminder) fires on a precise cadence without a self-managed cron host
- Target user
- Platform engineers automating recurring workflows on Slack's next-gen platform
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who builds Slack apps on the next-generation (Deno) platform and provisions triggers with the Slack CLI and the triggers API. I will provide: - The workflow callback_id the trigger should invoke and the inputs it needs - The desired cadence (start time, frequency, timezone, end condition) and which workflow inputs are static vs computed - Whether triggers are created via the CLI (`slack trigger create`) or at runtime via `workflows.triggers.create` Your job: 1. **Trigger definition file** — write the scheduled `Trigger` object (`type: "scheduled"`) with `schedule.start_time`, `frequency` (daily/weekly/etc.), `occurrence_count`/`end_time`, and `timezone`. 2. **Workflow input mapping** — map the trigger's `inputs` to the workflow's expected parameters, including any constant context the workflow needs. 3. **Provisioning path** — show both `slack trigger create --trigger-def` and the runtime `workflows.triggers.create` API call, and when to use each (CI/deploy vs dynamic per-tenant). 4. **Idempotency and updates** — explain that re-creating duplicates the trigger; use `workflows.triggers.update` keyed by stored trigger_id, and store ids per environment. 5. **Timezone and DST correctness** — set an explicit IANA timezone so the schedule survives DST shifts predictably. 6. **Lifecycle management** — show listing and deleting stale triggers (`workflows.triggers.list`/`delete`) so deprecated workflows do not keep firing. 7. **Verification** — describe how to confirm the trigger fired (activity logs) and how to test a one-off run before committing the recurring schedule. Output as: the trigger definition file, the CLI and API provisioning commands, and a small table of frequency options with example schedule blocks. Caution: creating a scheduled trigger twice (deploy + manual) produces two independent firings — always store and reconcile trigger_ids instead of blindly re-creating on each deploy.