- Steps
Action step
Conditional action step
Repeat step
Repeat in batches
Call Recipe step
Stop step
Action with error handler step
Example: Error monitor step
Example: Error monitor with retry step
Steps
Recipe steps can be actions or control flow statements that help you describe business logic.
![d1dd90d4-72af-481d-9d9d-008e42773369.png](https://s3.amazonaws.com/insightly.userfiles/36409/DYLDJQ/fd9f20d4-0548-47c6-a3ed-8c4d24cdf17b.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=kOyQLIb4aNltGL7W3PzssSwW1Oc%3D)
Action step
Actions carry out an operation in your target app, typically a create, update, or search operation. Each action requires a set of input fields and typically returns data i.e. output data tree.
Example: Action step
The following step carries out a Search organizations action in a Zendesk integration. The input fields on the left shows the available fields to search for a Zendesk organization by:
Name
Tags
Notes
Details
In the following case, the Search organization action is carried out by name.
![b7b6f37f-b0a8-46e7-9c74-426677ee284b.png](https://s3.amazonaws.com/insightly.userfiles/36409/MVN87E/63eca846-1c66-41ad-998f-6a0e4e2e2bde.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=GRFCW9qXFbLLEr0zyte0eKLTs2A%3D)
When the Search organizations action has been carried out, Zendesk returns data about the organizations found, if any. The output datatree displays available fields for mapping in subsequent steps.
In the following case, the Update organization action uses the ID field from the Search organizations action to identify which Zendesk organization to update (ID field as highlighted).
![95a8e4bb-6d5f-4fb6-996d-646397028b96.png](https://s3.amazonaws.com/insightly.userfiles/36409/OOB2KZ/68e98a46-e974-4cc8-8d37-923eb53351c5.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=sKLTS2aO9s73CUnGwDXobJMn1oE%3D)
Conditional action step
Conditional actions will only be carried out if the specified condition is true. All actions indented within a conditional action block will be carried out only if that condition is true.
Example: Conditional action step
The following Recipe has two conditional steps:
If Zendesk organization was found, update Zendesk organization
If Zendesk organization was not found, create new Zendesk organization
![fbfb649e-facf-4780-8a59-46b65a94b1f5.png](https://s3.amazonaws.com/insightly.userfiles/36409/JHMFIO/d01fc374-9bfe-4e0c-b88d-29bf9a703d89.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=SBYW4ETDDC9y6Z1NTinWq%2FKD%2BK0%3D)
In this example, any job can only proceed through either one of the conditional steps, as the Zendesk organization must have either been found or not.
Repeat step
When working with a list of items (e.g. a list of invoice line items), you may need to carry out a set of actions for every item in the list. The repeat step helps you do that.
Actions indented within a repeat block will be carried out for all items in the list.
The input to the repeat step is a list. Actions within a repeat block should use data output from the Repeat step's datatree. This ensures that every item in the list is processed.
Example: Repeat step
Refer to the example scenario of syncing new lines in a CSV file in Dropbox (using the batch trigger) to organizations in Zendesk.
![1024ea37-0ef0-44eb-8746-46e859527f82.png](https://s3.amazonaws.com/insightly.userfiles/36409/1XFCYP/5834d090-2ee2-4922-82ab-adb7556f331c.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=WmiOIMxthMDD%2BGNUPkRYf0gcMLM%3D)
In this example, the trigger returns a list of new lines in a CSV file in Dropbox. Since Zendesk does not support batch actions, each line must be added one at a time from Dropbox to Zendesk.
The list datapill has to be passed into the repeat step. When the input list field is selected, only list type datapills are usable in the datatree, as shown below. List type pills can be identified via their stack icon.
![1fefc90f-d619-4636-983c-3ca4223e01c1.png](https://s3.amazonaws.com/insightly.userfiles/36409/IH2TX6/3f6b2322-d6bc-413d-91cb-ddb7ccb5f076.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=kppq7sqXuoG6eK1MU9OpvkbFvW4%3D)
Datapills from the Foreach output datatree should be mapped to ensure that values from each list item are used when the action is repeated.
For example, if two organizations are fetched by the trigger, using pills from the Foreach datatree ensures that the Create organization action creates a Zendesk organization with the data from the first CSV line account on its first iteration, then with the data from the second CSV line on its second iteration.
![65725c56-9b7b-4faa-91c4-650dd86e1ee9.png](https://s3.amazonaws.com/insightly.userfiles/36409/D705GN/1fabf7d4-8a11-4ff2-9713-385ed44d0b72.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=va4w5b5B4EX5qTp48NfxhKo3NbQ%3D)
Repeat in Batches
Occasionally, the rate at which an upstream app or system transmits the data is faster than the rate at which a downstream app or system can receive it.
You can use the Repeat in Batches feature to process such a data movement by configuring the batch size. Large data sets are automatically parsed into smaller batches for transfer.
How to use
Follow these steps to use the Repeat in Batch feature:
Select the Repeat Action step from our “What happens next” container in the Recipe Editor.
Enter the Input List data pill in the Repeat Action step.
Invoke the Repeat in Batches feature by setting Repeat Mode to “Batch of items”. (The two options available are “One item at a time” and “Batch of items”.) Refer to figure below for more details.
Set the Batch size field. This defaults to 100 when the batch size is not specified or if the number specified is less than 1. Please note that a data pill can also be input here as a batch size.
You will see this reflected in the For each statement with the batch event tag.
Call Recipe step
Call Recipe will run another Recipe (named a callable Recipe). Callable Recipes are like functional calls in programming languages. They offer an easy way to reuse Recipe logic.
You should note that callable Recipes are executed synchronously. i.e. the calling Recipe will be blocked waiting for the called Recipe to finish processing.
Stop step
The stop step ends a single job from being processed any further. It is usually used in cases when there is an error in the business logic and further processing of the job is not required.
The stop step can be configured to mark the job as a failed or a successful, depending on business logic.
Example: Stop step
The following Recipe expects all Insightly organizations to be present in Zendesk as organizations. In cases where no corresponding Zendesk organization is found, the recipe will stop processing further actions.
![b2e8da58-3b2a-4290-8657-e442098086f7.png](https://s3.amazonaws.com/insightly.userfiles/36409/X63486/a3b83db4-4277-4fdd-86a2-5da475374e93.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=q7S%2B3eAfCYKC%2Bc8D5OO%2BKUjV1ic%3D)
Any job ran by this Recipe can proceed through either one of the conditional step, as the Zendesk organization must have either been found or not.
If not found, the job will stop at Step 4. If found, the job will not carry out actions within the conditional step (Steps 3 and 4), instead only updating the matching Zendesk organization.
This Recipe marks the job as an error, so that the recipe owner will take notice of this job and attempt to rerun it.
![077b8023-5ebd-486a-8c62-4c6570be4e11.png](https://s3.amazonaws.com/insightly.userfiles/36409/SW1YKG/2eedf959-7f3a-48e0-b6eb-79c9e65e6c0d.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=LVj0Hd93cdC9UI3c7RNlkSF4j1E%3D)
Action with error handler step
This step allows you to monitor for errors in actions, similar to the try/catch concept in programming languages. When an error occurs, you have the chance to:
Retry the sequence of actions again, in case it was a temporary error such as network issues, or
Take remedial actions, such as notifying users of the error via email or error messages in the app, or to carry out a rollback (i.e. reversing the job by deleting any created or half-created records).
This step consists of 2 blocks: the Monitor block and the Error block. Actions to be monitored for errors should be within the Monitor block. If all actions are successful, the Error block will be ignored. However, if any action in the Monitor block results in an error, the actions within the Error block will be executed.
Auto-retry
When using the error monitor step, you can setup the actions within the Monitor block to be auto-retried by AppConnect in cases of action failures. By default, the Monitor block actions will not be reran.
![4a4b11d6-7ad6-40a4-a807-f281ba0b1e64.png](https://s3.amazonaws.com/insightly.userfiles/36409/R20TJD/1908370b-be79-4ce9-8a36-60f2a3539ef7.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=TPE5OXv1u%2F0FZdt5PApvPxwIZl8%3D)
You have the option of retrying up to 3 times, and of selecting the time interval to wait between each retry.
![13670fe2-b279-441c-a967-3ceae77065be.png](https://s3.amazonaws.com/insightly.userfiles/36409/UB6WCX/2faf1391-183e-4d4e-9ccd-8d8cb0ef6b68.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=oxz4bEpHSG9F5AqHMK1tmfAX40k%3D)
You can also define a condition that has to be met before the Monitor block can be auto-retried.
Configuring the retry condition field. In this example, the actions in the Monitor block will only be carried out again if the error message does not contain the 401 error code.
![08c2cc6d-390e-4d26-b8a6-1cada691398f.png](https://s3.amazonaws.com/insightly.userfiles/36409/P6Y3ZE/c76012a5-d89c-4cc3-b290-7334bfe5e6bd.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=nLu46GBTVkMzgvzIXQo6gja2dLE%3D)
Example: Error monitor step
The following Recipe tries to update the Zendesk organization right after the search step, regardless of whether any Zendesk organizations were found.
In cases where no matching Zendesk organization is found, the Update organization action will fail.
![9264e6b1-1965-40d1-90df-7fc64fbb44bb.png](https://s3.amazonaws.com/insightly.userfiles/36409/RRD0HY/cb243653-028e-4624-a2ed-66f96a2021f5.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=E5zijqQZiDdNFVSmKvw%2F4t7HaAo%3D)
As the Recipe catches failed actions within the error monitor block, failed Update organization actions will be caught, and the Recipe proceeds to carry out steps within the Error block immediately, as no auto-retry was configured.
In this case, it seems that the only reason for the update failing is because no matching Zendesk organization was found. Hence the remedial step creates a new Zendesk organization.
Example: Error monitor with retry step
If the actions in your Monitor block tends to fail for temporary reasons such as network issues or timeout issues, it would make sense to use auto-retry, such that the Recipe will attempt to execute the steps again until it succeeds, for a maximum of 3 tries.
We will reuse the same error monitor example Recipe from above, where we try to update the Zendesk organization right after the search step, regardless of whether any Zendesk organizations were found. In cases where no matching Zendesk organization is found, the Update organization action will fail.
![22298de2-8ec1-46f3-b897-af9157663da6.png](https://s3.amazonaws.com/insightly.userfiles/36409/PQ4P4Y/4bd1cda4-34d0-44a5-ae9e-5aa74c146b79.png?AWSAccessKeyId=AKIAJRNAGB7KJX37RU4Q&Expires=1725752321&Signature=mQXmih0RIsZTqRRf1VcRvPHD85w%3D)
If updating the Zendesk organization fails, the Recipe will check to see if the error message contains a 401 error code (i.e. unauthorized error).
If the error is an unauthorized error message, we know that further attempts will still fail as this means we don't have the right permissions to update the Zendesk organization, perhaps because of changed permissions.
If the error is not an unauthorized error message, we will proceed to retry the update organization action again after the specified period of time, e.g. 5 seconds, up to a maximum of 3 tries.