npm.io
1.0.1 • Published 4 years ago

alloy-sdk

Licence
ISC
Version
1.0.1
Deps
2
Size
3 kB
Vulns
24
Weekly
0

alloy-sdk

This is a tiny wrapper that makes a POST request to run an Alloy workflow.

Usage

import {runAlloy} from 'alloy-sdk';

...

await runAlloy({
  // You can find this on Step 4 of the Webhook block in your workflow
  workflowId : '<workflowId>',

  // required for authenticated workflows; found in Forge Settings
  apiKey: '<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.

Keywords