This cookbook describes how to mirror approvals from other business systems into your AI assistant. You can use this cookbook to recreate the experience that your users have with our built-in approval mirroring experience.
This specifically ensures that your users get the full experience of our Approval Queue (i.e. ability to ask “which approvals do I still need to complete”).
At a high-level, there are going to be two plugins needed in order to build this experience.
Trigger Webhook. Triggered by the polling plugin.
For this cookbook, assume the payload looks something like this:
Body: Compound action. Notifies the user and processes their response.
Rate Limits. Approvals tend to be bursty, so we recommend building rate limit checks into your plugin.
Stale Approvals. After you send your approval request, it can go “stale.” For example, the user might log into the application and approve it there, but the approval request will still be in the assistant. Or another approver might handle the request, making the user’s response irrelevant.
We recommend validating the approval is still “fresh” before taking action. However, there is currently no way to remove it from their “queue” of approvals.
Duplicate notifications. To avoid notifying the same user twice about the same approval, you should implement some sort of deduplication logic in your compound action. We recommend that you…
created_on date)Approval requests will expire after 30 days. Generally users don’t act on requests that are over 30 days old. So if your approval request expires, we recommend escalating to a different owner rather than just notifying the same user again.