Airtable as an Approval Queue with Pipedream
No only can you trigger a Pipedream workflow with a button in Airtable, but you can also suspend a live workflow until it's approved by a real person in Airtable.
Why would you use an approval queue?
This is very handy to add a human-in-the-loop for pausing a Pipedream automation that requires a person to review the action.
We'll use the built in $.flow.suspend
to suspend the workflow until we approve or cancel the workflow in Airtable.
You may want to do this for sensitive operations that involve deleting data, or banning access, or granting privileges.
Copy this workflow to your Pipedream account, or follow along below!
How does it work?
When you call $.flow.suspend
in a Node.js code step, it will return a resume_url
and a cancel_url
. These unique URLs will respectively resume or cancel the workflow:
```javascript
const { resume_url, cancel_url } = $.flow.suspend();
```
In the same step, we'll create a new Airtable record with these URLs with URL fields:
Then we can add a Button to Airtable that opens up one of these URLs.
That will either resume the execution of the event, or cancel it.