2020-09-17 01:00:04 +12:00
|
|
|
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",
|
2020-09-17 06:25:52 +12:00
|
|
|
stepId: "DELAY",
|
2020-09-17 01:00:04 +12:00
|
|
|
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)
|
|
|
|
}
|