Circuit's Task Engine state is used to connect with other applications and access APIs from a closed space. To retrieve data from a private network, the required API must be accessed from the local machine's network for the required conditions.
Prerequisite
For more details about the Task Engine module in Bridge, the keys, and its description, click here.
Example Use Case: During the employee onboarding process, after all the necessary employee provisioning is done, it is important to update the status in the HR team's recruitment software. To accomplish this, the Task Engine state can be utilized, and the provided API can be consumed to update the onboarding status.
Let us see how to configure Task Engine in Builder View and Code View.
Builder View
For associating a Task Engine state to a circuit:
-
In Builder View, drag and drop the Task Engine state from the left pane into your circuit or click the required Task Engine state in your circuit.
-
Bridge/Cluster ID: Select the appropriate bridge or cluster from the drop-down list to execute the task.
-
Under the Add Configuration section, fill in the following fields:
-
Credential ID: Select the credential from the dropdown list. The Credential IDs of all the credentials created for the Task Engine module type will be displayed in the list.
-
Request Method: Choose one of the methods: GET, POST, PUT, or DELETE.
-
Request URL: Enter the API URL.
-
For GET and DELETE methods, enter the API URL only.
-
For POST and PUT methods, enter the API URL and choose the Body Type:
-
Text, JSON, XML, HTML, JavaScript: Enter the data directly in the Content section.
URL Encoded, Form Data: Click Add in the Body section and enter data as key-value pairs.
-
-
Error Handling (optional): Select and configure error handling options. For detailed information, refer to Error Handling in Circuit states.
-
In the Input /Output section, you can optionally fill in the following fields:
-
-
Parameters: Click Add Parameter and specify the parameter name and parameter value. These parameters will be sent to the third-party application while triggering the webhook.
-
Headers: Click Add Header and specify the header name and header value. The configured headers will be appended to the API request while triggering the webhook.
Code view
In Code View, the JSON to configure the Task Engine state to update status using an API is given below:
"Update Onboarding Status": {
"type": "task_engine",
"next": "Onboarded Successfully",
"payload": {
"credential_id": "api_cred_1",
"method": "POST",
"url": "https://recruitapp.com/update_status",
"parameters": {
"employee_name": "John Mathew",
"employee_email": "john_mathew@sweriomail.com",
"onboarding_status": "onboarded"
},
"headers": {
"AuthorizationKey": "$.APIKey"
}
},
"bridge_id": "bridge-1369_1"
}
Related Articles
Task Engine
In Qntrl, while public APIs can be configured and executed directly through Webhooks, the client's internal APIs that are exposed only to the local network can be executed using the Task Engine module in Bridge. The Task Engine configured in Bridge ...
Bridge Agent Configuration
The Bridge Agent serves as the local management console for your Bridge. It allows you to view and control services, review messages and logs, configure modules, manage credentials, and maintain secure communication with external systems. Log in to ...
PowerShell Task Engine
These states are used to perform any actions in the Windows machines of a private network using PowerShell commands. There are six states available in the PowerShell Task Engine for performing different operations. PowerShell Engine Install ...
DB Engine
This state enables a connection with the database hosted on a private or local network and executes the defined SQL query in the database. Prerequisite An active Bridge agent. Refer here to install and configure Bridge. Create the necessary ...
DB Engine
DB Engine is used to connect with the database in the client's machine or client's network and perform READ/INSERT/UPDATE operations in the database. The DB Engine configured in Bridge can be utilized in the following two distinct modules within ...