* fix(workflows=sdk): Fix StepFunction typings and custom step name * Create smart-nails-switch.md * fixes * fixes * fixes --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
import { createStep, createWorkflow, StepResponse } from "./composer"
|
|
|
|
const step1 = createStep("step1", async (input: {}, context) => {
|
|
return new StepResponse({ step1: ["step1"] })
|
|
})
|
|
|
|
const step2 = createStep(
|
|
"step2",
|
|
async (input: { filters: { id: string[] } }, context) => {
|
|
return new StepResponse({ step2: input })
|
|
}
|
|
)
|
|
|
|
const step3 = createStep("step3", async () => {
|
|
return new StepResponse({ step3: "step3" })
|
|
})
|
|
|
|
const workflow = createWorkflow("workflow", function () {
|
|
const step1Res = step1()
|
|
step3()
|
|
return step2({ filters: { id: step1Res.step1 } })
|
|
})
|
|
|
|
workflow()
|
|
.run({})
|
|
.then((res) => {
|
|
console.log(res.result)
|
|
})
|
|
|
|
/*const step1 = createStep("step1", async (input: {}, context) => {
|
|
return new StepResponse({ step1: ["step1"] })
|
|
})
|
|
|
|
const step2 = createStep("step2", async (input: string[], context) => {
|
|
return new StepResponse({ step2: input })
|
|
})
|
|
|
|
const step3 = createStep("step3", async () => {
|
|
return new StepResponse({ step3: "step3" })
|
|
})
|
|
|
|
const workflow = createWorkflow("workflow", function () {
|
|
const step1Res = step1()
|
|
step3()
|
|
return step2(step1Res.step1)
|
|
})
|
|
|
|
workflow()
|
|
.run({})
|
|
.then((res) => {
|
|
console.log(res.result)
|
|
})*/
|