In this article, you will learn how to create and add Custom Activities to your Guided Flows.
Why Create Custom Activities?
To understand the purpose of Custom Activities, let's first recall what an Activity is.
An Activity is an event that helps Integry complete an Integration Flow.
Let's say, you want to sync your list of tasks between two task management apps, Trello and Todoist. The Integration would work in the following way, "If a task card is created in Trello, a similar task is created and added to Todoist."
Before creating any Flow in Integry, you need to create an App Connector for the apps that are to be used in a Flow. Additionally, you have to create the relevant Activities in your App Connector. These Activities are then added to your Flows and the Flows are added to your Deployments for your end-users to use the integrations.
Integry provides its customers with more than hundred ready-made Flows that their end-users can use to set up the desired integrations with their favourite applications. The Flows for both the apps that we are using in this example are already available in Integry.
However, if you can't find a required Activity for an application to add to your Flow, you can create Custom Activities in the Flow builder.
In this guide, we will explain the process of creating Custom Activities by creating a Flow for Sendinblue app (Trigger) and MailChimp app (Action). This Guided Flow is designed to add a subscriber to a MailChimp account once a contact gets created in the Sendinblue account.
We will show you how to add a Custom Action to this Flow.
First, we'll add a Trigger step to our Flow. The integration shall initiate when a contact gets created in Sendinblue, so we'll configure our Trigger step accordingly (shown above). When the Trigger is successfully added, click on 'Done' to proceed.
Next, you have to add an Action step to the Flow. The Action we want to perform to our action application (Mailchimp) is "create a subscriber for the contact created in Sendinblue."
Step 1: As you'll add the Trigger step to your Flow, you will be prompted to add the Action step (as the Trigger's child step) to your Flow. Select the App Connector for the action application, which, in this case, is Mailchimp.
Step 2: Next, you have to select the required Action from the dropdown menu. The Create Subscriber Action is not available in the dropdown menu, so we'll create our Custom Action by choosing the last option in the menu (shown above).
Step 3: Add your account.
Configuring the Fields for the Custom Activity
Step 4: You will see the following section where you can configure the fields for the Custom Action.
- Description: Add a description to the Custom Action.
- Action Name: Add a name for your Custom Action.
- Reusable: Toggle it on to use this Custom Action in other steps and Flows.
- API endpoint: Enter the API endpoint here. An API Call will be made to this endpoint to perform the Action. In the running example, we have to create a subscriber in Mailchimp. So we'll enter the POST verb, the Base URL, and the resource URI of the endpoint (where the Action is to be performed).
- Headers: Add the Headers for your API Call here. To learn how to configure the API endpoint and Header for your API Call, go through the application's API documentation.
- Pagination: This is a toggle button. It enables you to convert the Custom Action into a Custom Query. That way, you can perform a bulk operation using the Custom Activity. In the running example, if we were to create multiple subscribers in our Mailchimp account at once, we could toggle this option on.
Save your configurations for the Custom Activity before testing it.
Testing the Custom Activity
Next, test the Custom Activity see if it is performing the intended operation.
Step 5: Click on 'Test.'
If your test was successful, click on the Test Result section to expand the results of the API Call. In our case, the successful test results show that a subscriber has been created in our Mailchimp account.
Using Custom Activities to Fetch Missing Attributes in Triggers
Continuing the above example, let's say we have added a Trigger step to our Flow that fetches the new contact information from our Sendinblue account. The Trigger result shows us the attributes such as first name, last name, address, etc., but it doesn't fetch the email address of the contact.
Let's assume that to perform the Create Subscriber Action in our Mailchimp account, we need to send the email information when creating subscriber.
In this scenario, we can create a Custom Action that fetches the missing attributes from the Trigger application (in our case, Sendinblue).
Let's create the above-mentioned Flow.
After adding the Trigger step to your Flow, add a new child step for your Trigger.
Since we want to fetch information from our Sendinblue account, we'll choose Sendinblue app to create a Custom Action that brings contact details.
Choose the Custom Action (Advanced) option from the dropdown menu.
Next, we'll configure the Custom Action that brings contact details from the trigger application, i.e., Sendinblue.
We'll configure the details, name, and reusability of the Custom Action.
Next, we'll configure the API Call that we'll make to Sendinblue app.
- HTTP method - We'll select the Get method as this call is made to fetch the contact details from the third-party application.
- Base URL - Select the consistent part of the API URL.
- Resource URI - This is the path of the endpoint resource where the API Call will be made to fetch contact info.
- Header - We'll add the authorization header here.
Go through the third-party application's API documentation to learn how to configure the API Call in Integry.
Next, we can turn the Pagination toggle on to fetch all the contacts from our Sendinblue list. To learn how to configure the pagination settings, visit this guide.
We'll save and test this step.
In the above image, you can see the email address attribute and other contact details in the response of the API Call.
Similarly, you can create Custom Activities to design your Flows according to your requirement and build powerful integrations for your end-users.