Skip to main content

Notifications

Some generative tools may require several minutes to complete processing, which can negatively impact the user experience. To improve usability, this feature allows users to close the tool and receive a notification once the generation is complete.

Enabling Notifications

To enable notifications for your task, make sure notifications are enabled for the task in your worker's configuration. Refer to Task Registration page for details on how to configure this.

Notifications options

An optional notification object can be passed when submitting a task via the Async API:

"notification": {
"projectId": "...",
"miniappPackageId": "...",
"actions": [{
"deeplink": "...",
"mobileDeeplink": "..."
}]
}
  • projectId - the ID of the project from which the task was triggered
  • miniappPackageId - the ID of the miniapp from which the task was triggered
  • actions - call-to-action (CTA) deeplinks
note

The deeplink(s) specified in the actions will be updated by the backend to include the task_id as a query parameter, enabling the miniapp to correctly restore its state.

Dynamic Notifications

Static notification config may not always be sufficient — you may want to tailor the notification title, description, or CTA label based on the request, error, or any other context available during execution.

You can override notification content at runtime from within your executor using flow.meta().configureNotification(). Dynamic overrides take precedence over the static application.yaml config.

flow.meta().configureNotification({
title: "Your images are ready",
description: `Generated ${result.count} images`,
});
note

Requires pluggable-worker-core version 6.16.0 or higher.

All fields are optional — only specify the ones you want to override. Unset fields fall back to the static config.

FieldUsed WhenDescription
titleTask succeededNotification title
descriptionTask succeededNotification description
cta_labelTask succeededCall-to-action button text
error_titleTask failedNotification title on failure
error_descriptionTask failedNotification description on failure
error_cta_labelTask failedCall-to-action button text on failure