This topic was automatically generated from Slack. You can find the original thread here.
I need a way to make a 48 hours delay but send the cancel link to different endpoint (to save the link) before the dealy.
How to?
This topic was automatically generated from Slack. You can find the original thread here.
I need a way to make a 48 hours delay but send the cancel link to different endpoint (to save the link) before the dealy.
How to?
This section of the docs explain how to do that, copying here the code example:
import { axios } from '@pipedream/platform'
export default defineComponent({
async run({ steps, $ }) {
const { cancel_url, resume_url } = $.flow.delay(15 ** 60 ** 1000)
// Send the URLs to a system you own
await axios($, {
method: "POST",
url: `https://example.com`,
data: { cancel_url, resume_url },
});
// Email yourself the URLs. Click on the links to cancel / resume
$.send.email({
subject: `Workflow execution ${steps.trigger.context.id}`,
text: `Cancel your workflow here: ${cancel_url} . Resume early here: ${resume_url}`,
});
}
});
// Delay happens at the end of this step
Thank you!