Notifications
Send messages to notification channels and pause flows for human validation.
$notify(channelId, message, options?)
Send a notification to a configured channel (Slack, Discord, or Telegram). channelId is the channel ID.
await $notify('channel-id', 'Deployment complete!');
await $notify('channel-id', 'New invoice downloaded', {
link: { url: 'https://app.example.com/invoices/42', label: 'View invoice' },
showRunId: true,
});| Option | Default | Description |
|---|---|---|
link | null | { url, label } - rendered as a button (Telegram inline keyboard, Discord button, Slack action). |
showFlowId | false | Prefix the message with the flow ID. |
showRunId | false | Prefix the message with the run ID. |
Throws if the channel ID is not found (lists available channels in the error message).
$waitHumanValidation(waitingMessage?, channelId?, options?)
Pause the run until a human clicks "Continue run" in the Puppetflow UI. Optionally sends a notification to a channel when pausing.
// Notify and wait
await $waitHumanValidation('Please review before continuing.', 'channel-id');
// Silent wait (no notification)
await $waitHumanValidation();When channelId is provided, the notification includes a link back to the run in the UI. The default options for the notification are:
| Option | Default |
|---|---|
showFlowId | true |
showRunId | true |
link | Auto-generated link to the run page. |
These can be overridden via the options parameter.
TIP
If the flow or run is deleted while waiting, the function throws an error and aborts instead of waiting forever.
