Salesforce

Run a flow via a job in Automate Studio

« Go Back
Information
Run a flow via a job in Automate Studio
000004003
Public
Product Selection
aiWare - aiWare
Article Details

Running a flow via job lets you use GraphQL to call your active flow and pass it data.

Steps

  • In GraphQL, call the createJob mutation below after you set the second engineId to the engine ID of your flow, and set url to the data you want to pass to your flow.
    mutation runFlowAsEngineJob {
        createJob(
            input: {
            #create TDO
            target: {
                        status: "downloaded"
            }
            tasks: [
                {
                # Igniter Engine - Wrapper for payload to Automate flow
                engineId: "5305265c-d566-4716-8904-debf7e0ac857"
                payload: {
                    url: "URL OF DATA TO PASS TO YOUR FLOW"
                }
                ioFolders: [
                    {
                    referenceId: "igniterOutput"
                    mode: chunk
                    type: output
                    }
                ]
                executionPreferences: {
                    priority: -99
                }
                }
                {
                # Automate Flow where the aiware-in node accepts a URL param
                engineId: "ENGINE ID OF YOUR FLOW"
                executionPreferences: {
                    priority: -99
                }
                ioFolders: [
                    {
                    referenceId: "flowInput"
                    mode: chunk
                    type: input
                    }
                ]
                }
            ]
            routes: [
                {
                parentIoFolderReferenceId: "igniterOutput"
                childIoFolderReferenceId: "flowInput"
                }
            ]
            }
        )
        {
            #return the newly create TDO ID and the job ID
            targetId
            id
        }
        }

    The mutation returns a response like this that contains your TDO ID and job ID. 

    {
        "data": {
            "createJob": {
            "targetId": "2020797528",
            "id": "22341620_kk1BSuE9Wz"
            }
        }
        }
Additional Technical Documentation Information
Properties
12/27/2023 10:48 PM
1/2/2024 11:36 PM
1/2/2024 11:36 PM
Documentation
Documentation
000004003
Translation Information
English

Powered by