Run Flow & Get Results
When flow is fully configured, you can run it. You have two options for doing this:
  1. 1.
    Let user run flow at the end of the configuration, right from the popup.
  2. 2.
    Run flow via SDK or API after it is configured.
We will use the first approach in this tutorial. For this, simply add run: true parameter to the openFlow function and add a callback that will receive the output:
iApp.openFlow(flow.id, {
run : True,
onFlowRunComplete: (output) => {
// You results handler is going here
console.log(output)
}
})
After going through the flow configuration, you will see its output in the console.
To put it all together, here is the full code that creates a flow, opens a popup, and outputs results after a flow run was completed:
async function importData() {
const flow = await iApp.createFlow({
// Insert your blueprint key here
blueprintKey: "getting-started"
});
iApp.openFlow(flow.id, {
run: True,
onFlowRunComplete: (output) => {
// You results handler is going here
console.log(JSON.stringify(output));
}
});
}
​
Copy link