Steps in a Flow
Last updated
Last updated
Add the HTTP call step to a trigger block to make a call to an API endpoint of any app that Integry supports, including yours.
Note: If your app does not have a public API, please review our recommendations before you build it. Alternatively, you could also just connect directly to your database!
Integry supports 200+ apps. You can add a query or an action of those apps as a step in a flow block.
In order to run those queries or actions, we will get your user to login to the app (hence, "using user's auth"), and configure any fields that require their input. You can pre-configure some parts of it.
Alternatively, you can also perform an action in another app using your auth. In that case, you will login and configure the step.
A trigger block can include both types of actions.
Typically, you would perform an action in another app using user's auth as a step in a flow block. However, that action will be executed using your user's account of that app. What if you want to use your own account?
Let's consider an example:
When an Account is Created in Salesforce, you make an HTTP call to your app (with the account details) to add a new contact. You also then send an email notification to the user informing them that a new account just got synced.
Accounts are accessed from Salesforce using the user's auth.
The HTTP call is made to your app using an API key of your app.
The email notification is sent using the Send New Email action in the Mailchimp Transactional app using your auth. You obviously want to send notifications to your users from your account.
Sometimes when building your flows, you need to add custom logic, formatting or processing. You can do all of this using Custom Code.
You can add custom code at any point in your flow. The code step supports Python 3.12 with additional languages planned.
Your code must be enclosed in a main() function
You have access to the global steps dictionary of all the steps in the flow including their in variables and out variables
Anything you return becomes available in the flow in the code steps's out variable
You can return any data type and it will be made available: strings, numbers, dictionaries, arrays etc
You can also create functions and use them in your code
Here's sample code that returns a full name by concatenating first name and last name with a space
You can see that we're referring to steps global dictionary to access salesforce_contact_created trigger's first_name and last_name.
You can insert fields using the insert field menu
Once you have your code written out, you can test it by hitting the, you guessed it, the Test button. You'll see the exact output below. The structure of the output is important since it will be made available in the field insert menu for any subsequent step.
Here's the output of code we tested:
In the subsequent steps, the field insert menu for the code step has:
If you return a dictionary, it will be available as-is in the output:
Here's the field insert menu:
You can also output arrays and more complex nested dictionaries
You can import Python modules as well. We support any standard modules, as well as lxml, bs4, and pytz
You can mention the module you want to import at the top
The IF condition step allows you to add branching logic to a trigger block.
The conditions are evaluated at run-time and the steps in the appropriate group -- IF, ELSE IF, ELSE -- are executed.
For instance, if the value of a "Type" field in the trigger payload from another app equals "Created", run the Create action in Acme. Otherwise, run the Update action in Acme.
An IF condition can have one or more condition statements that each have three parts: data, operator and value. These statements can chained with an AND or OR operator.
For instance, this checks if the "type" field value is "Created" or "created".
The steps in the IF condition group will run if, at run-time, the entire expression is true.
If you want to add more branching logic to the IF condition, you can add one or more ELSE IF steps from the Add Step menu. Each ELSE IF will have it's own condition statements, and steps to run if the condition statements are true at run-time.
Finally, you can also add an ELSE branch to the IF condition that will execute if the IF condition, and all it's ELSE IFs (if you've added any), fail, i.e., their condition statements result in false.
A condition statement has three parts: data, operator, and value.
Typically, data (left-hand side) will be a field, possibly from the output of a previous step, the value (right-hand side) will be a static value (but can be a field's value at runtime as well), and the operator will specify how to compare the two sides. Some operators, like is empty or is true, already include the respective values so you don't have to specify them.
Integry supports conditional statements in two types of steps: IF condition, and Do While Loop.
When using the Conditions, you don't have to specify data type, Integry will make best effort to coerce the type and use the appropriate comparison. When entering strings, you do not need to enclose them in quotes, the same is true for numbers. In addition, comparison is case sensitive for strings.
This operator checks if left hand side is equal to right hand side.
This operator is a negation of "equals", and will evaluate to true for all cases where "equals" evaluates to false, and false otherwise.
This operator checks if given value is true. If the value is not a boolean, following rules are used to evaluate the condition.
If value is an array, the operator evaluates to true if array is empty, false otherwise.
If value is an object, the operator evaluates to true if object has at least one key, false otherwise.
If value is a string, the operator evaluates to true if string is not empty and not false or null, false otherwise.
If value is a number, the operator evaluates to true if number is not 0, false otherwise.
This operator is a negation of "is true", and will evaluate to true for all cases where "is true" evaluates to false, and false otherwise.
This operator checks if right hand side is part of left hand side. The following rules are used to evaluate the condition:
If left hand side is a string, the operator evaluates to true if right hand side is present in the string, false otherwise.
If left hand side is an array, the operator evaluates to true if right hand side is present in the array, false otherwise.
If left hand side is an object, the operator evaluates to true if right hand side is present in the object as a value, false otherwise.
If left hand side is a boolean, number or null, it is coerced to a string and operator is applied on the string value.
This operator is a negation of "contains", and will evaluate to true for all cases where "contains" evaluates to false, and false otherwise. Similar to contains, you can use strings, arrays or objects.
This operator checks if elements at the start of left hand side are equal to right hand side.
If left hand side is not a string, following rules are used to evaluate the condition.
If left hand side is a string, the operator evaluates to true if the right hand side is the start of the string, false otherwise.
If left hand side is an array, the operator evaluates to true if the right hand side is the first element of the array, false otherwise.
If left hand side is an object, the operator evaluates to false.
This operator is a negation of "starts with", and will evaluate to true for all cases where "starts with" evaluates to false, and false otherwise.
This operator checks if elements at the end of left hand side are equal to right hand side. If left hand side is not a string, following rules are used to evaluate the condition.
If left hand side is an array, the operator evaluates to true if the right hand side is the last element of the array, false otherwise.
If left hand side is an object, the operator evaluates to false.
This operator checks if left hand side is greater than right hand side. If either side is not a number, following rules are used to evaluate the condition.
If either side is a string, a lexicographical comparison is performed.
If either side is a boolean or null, it is coerced to a string and a lexicographical comparison is performed.
If either side is an array, the operator is applied on each element using "AND" logical relation.
If either side is an object, the operator is applied on each key and value using "AND" logical relation.
This operator checks if left hand side is less than right hand side. If either side is not a number, following rules are used to evaluate the condition.
If either side is a string, a lexicographical comparison is performed.
If either side is a boolean or null, it is coerced to a string and a lexicographical comparison is performed.
If either side is an array, the operator is applied on each element using "AND" logical relation.
If either side is an object, the operator is applied on each key and value using "AND" logical relation.
This operator checks if value is an empty string. If value is not a string, following rules are used to evaluate the condition.
If value is an array, the operator evaluates to true if array is empty, false otherwise.
If value is an object, the operator evaluates to true if object has no keys, false otherwise.
If value is a boolean, number or null, the operator evaluates to false.
This operator is a negation of "is empty", and will evaluate to true for all cases where "is empty" evaluates to false, and false otherwise.
Add an abort step to a flow block to abort the execution of a run. This is used when you want to explicitly handle execution errors (and don't want Integry to kill the run).
Add a wait step to a flow block to pause the execution of a run for a set period.
A Do While Loop allows you to execute a group of steps in a trigger block, and then either repeat the group or exit the loop depending on one or more condition statements.
For instance, get all records by making repeated HTTP Calls to an endpoint that returns 100 records per page, until there are no more records available, loop over the records in a page (using a For Loop), and create customers in Acme.
Add the steps you want to repeat to the Do step group.
The loop will continue to repeat while the condition is true. The condition is specified as one or more condition statements that each have three parts: data, operator, and value. These statements can be chained with an OR or AND operator.