[Go to site: main page, start]

Skip to content

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.

js
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,
});
OptionDefaultDescription
linknull{ url, label } - rendered as a button (Telegram inline keyboard, Discord button, Slack action).
showFlowIdfalsePrefix the message with the flow ID.
showRunIdfalsePrefix 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.

js
// 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:

OptionDefault
showFlowIdtrue
showRunIdtrue
linkAuto-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.