API Development

Change an Axway Integration Builder Flow Trigger Type

Change Integration Builder Flow Trigger Type

So, you created a flow in Integration Builder and you want to change the trigger type. For example, say that you created or found a cool scheduled trigger flow that you want to use, but your application does not call for a cron job. Instead, you’d like to have a manual triggered flow that can be invoked via an API call to the flow as described here.

When you import the scheduled triggered flow, there is no option to convert it to a manual triggered flow. So, you’re stuck, right? Not necessarily.

Flows are JSON objects. When you export a flow, you are exporting a JSON object. Go ahead and try it and look at the file. In the JSON object you’ll see a triggers array. For example, here is the JSON for a simple scheduled trigger flow:

{
  "id": 28901,
  "name": "Scheduled Flow Example",
  "userId": 21107,
  "accountId": 18281,
  "createdDate": "2019-08-20T21:01:26Z",
  "steps": [{
    "id": 205261,
    "onSuccess": [],
    "onFailure": [],
    "name": "consoleLog",
    "type": "script",
    "properties": {
      "body": "console.log(trigger);"
    }
  }],
  "triggers": [{
    "id": 25578,
    "onSuccess": ["consoleLog"],
    "onFailure": [],
    "type": "scheduled",
    "async": true,
    "name": "trigger",
    "properties": {
      "cron": "${config.cron}"
    }
  }],
  "engine": "v3",
  "active": true,
  "singleThreaded": false,
  "debugLoggingEnabled": true,
  "configuration": [{
    "id": 52146,
    "key": "cron",
    "name": "cron",
    "type": "value",
    "required": true
  }]
}

You can edit the trigger and convert it from scheduled to manual. You just need to know the format.

Here is a manual trigger flow trigger:

...
,
"triggers": [{
  "id": 27924,
  "onSuccess": ["prepareSendToTeams"],
  "onFailure": [],
  "type": "manual",
  "async": true,
  "name": "trigger",
  "properties": {}
}],
...

In this case we simply need to modify the type from “scheduled” to “manual” and import the modified JSON file!!! Note that in this case, we can remove the cron property from the properties object, leaving it empty as we have in the manual trigger example above.

That was pretty simple!!!

Read more about automating sales documentation repositories using AMPLIFY Integration Builder.