import { workflow, step, ref } from "@executioncontrolprotocol/core"
import jsonataExtension from "@executioncontrolprotocol/plugin-jsonata"
import { extension } from "@executioncontrolprotocol/core"
export default workflow("reshape-payload")
.with([extension(jsonataExtension)])
.run([
step("@executioncontrolprotocol/jsonata.transform", "Reshape")
.with({
expression: "{ name: payload.user.name }",
payload: { user: { name: "Ada" } },
})
.as("reshape"),
step("@executioncontrolprotocol/test.echo", "Echo result")
.with({ value: ref("reshape") })
.as("echo"),
])