Run Alloy workflows from a nodejs server
npm install alloy-sdk
import {runAlloy} from 'alloy-sdk';
...
await runAlloy({
// You can find this on Step 4 of the Webhook block in your workflow
workflowId : '',
// required for authenticated workflows; found in Forge Settings
apiKey: '',
// each parameterName should match what you entered in the Parameter fields on the Webhook block
data: {
parameterName: 'Parameter Value'
},
// Set this flag to retrieve output from workflow
returnExecutionData:true,
});
`
Workflow Output
If the returnExecutionData option is set, then runAlloy() will return an array of all block output. Be aware that the returnExecutionData` flag can add a significant amount of latency, since the function will have to wait for the workflow to finish running.