1
0
Fork 0
mirror of synced 2024-09-21 11:53:49 +12:00
budibase/packages/server/src/workflows/steps/delay.js

26 lines
570 B
JavaScript
Raw Normal View History

const wait = ms => new Promise(resolve => setTimeout(resolve, ms))
module.exports.definition = {
name: "Delay",
icon: "ri-time-fill",
tagline: "Delay for {{inputs.time}} milliseconds",
description: "Delay the workflow until an amount of time has passed",
inputs: {},
schema: {
inputs: {
properties: {
time: {
type: "number",
title: "Delay in milliseconds",
},
},
required: ["time"],
},
},
type: "LOGIC",
}
module.exports.run = async function delay({ inputs }) {
await wait(inputs.time)
}