Activities
Activities are used to implement logic that executes specific tasks within a workflow. An activity can be invoked by one or multiple workflows. The logic within an activity does not need to be deterministic, allowing for the implementation of any type of functionality. Examples include calling an API, sending an email or SMS, and executing a database query.
Key Characteristics of Activities
Independent Execution:
Activity functions run separately from the workflow, allowing them to be retried automatically in case of failure.
Stateless: Each activity function runs independently and does not retain state between executions.
Durability & Reliability:
If an activity fails, the framework can automatically retry it based on the configured retry policies.
Scalability:
Activities can be executed in parallel, making them well-suited for distributed processing.
Examples of Activity Functions:
- Calling an external API
- Sending an email or SMS
- Querying or updating a database
- Processing files
Create Activity
Follow the below steps to create a activity:
- From the explorer menu, right-click Activities and select Add Folder.
- Provide a suitable name for the folder. These folders can be used to segregate and categorize the related activities together.
- Right-click the created folder and select Add Activity.
- In the properties panel, configure the properties as required and then click the Save icon.
| Property | Description | Comments |
|---|---|---|
| Name* | A unique identifier for the Activity. | Starts with a letter (A-Z or a-z) Contains only letters, numbers, and underscores (a-z, A-Z, 0-9, _) Cannot start with a number or underscore No special characters like -, $, ., or spaces Must have at least two characters |
| Group | Name of the folder is displayed here. | This property cannot be edited. |
| Async Operation* | Specify whether the activity is an async operation or not. Either Yes or No. | By default, it is set to No. |
| Description | A brief explanation of the Activity purpose. | Helps users understand the Activity functionality. |
| Is Active | Specify whether the activity is active for accessing or not. Either Yes or No. | Options: Yes (active) or No (inactive). Defaults to Yes. |
Note: An asterisk (*) denotes that the property is mandatory for creating an activity.
The "Activity added successfully" message displays upon successful creation.
- The activity designer canvas shows the Start and Stop constructs by default. From the toolbar , add the required constructs and configure them as required inside the flow to create a logic. For more information on constructs, refer to Configure Constructs.
- Click the Save icon to save an activity.
The "Activity updated successfully" message displays upon successful update.
Structure of an Activity
The created activity contains the following:
- Input Params
- Output Param
- Variables
- Exceptions. A base exception is created by default when an activity is created.
Add Input Parameters, Output Parameter and Variables
Users can add the parameters and variables to an activity as applicable. To add, follow the below steps:
- Right-click Input Params (or) Output Param (or) Variables and select Add. A pop-up window displays.
- Configure the below properties as required and the click Save.
| Property | Description | Comments |
|---|---|---|
| Parameter Name* | A unique identifier for the parameter. | What It Supports? Starts with a letter (A-Z or a-z) Allows letters, digits, and underscores after the first character. Supports single-character variable names Empty trailing characters after the first letter are allowedShape What It Does Not Support? : Does not start with a letter Contains unsupported special characters Empty strings are still invalid |
| Is Array | Specify whether the parameter is an array or not. | By default, it is set to No. |
| Data Type* | Select the data type of the parameter from the drop-down. | 1) For Map Configuration When the Map type is selected, additional fields appear: Key Type: Specifies the data type of the map's keys. Supports all primitive types. Value Type: Defines the data type of the map's values. Supports both primitive and complex types. Map types are not allowed as value types. Is Array (for Value Type): Determines if the value type should be an array. The Is Array checkbox controls the array status of the value type only. Behaviour: The Default Value field is NOT visible when the Map type is selected. 2) Default Value Controls: Boolean: Dropdown with True and False options. String: Textbox for string input. Integer, Double, long: Numeric textbox. DateTime: Two options: Fixed: Displays a calendar for date selection. Current: Uses the current date and time. |
| Description | A brief explanation of the parameter purpose. | Helps users understand the parameter functionality. |
Note: An asterisk (*) denotes that the property is mandatory for creating a parameter or variable.
The success message displays upon successfully adding a parameter or variable.
Add Exceptions
Users can add the exceptions to an activity as applicable. To add, follow the below steps:
- Right-click Exceptions and select Add. A pop-up window is displayed.
- Configure the below properties as required and the click Save.
| Property | Description | Comments |
|---|---|---|
| Name* | A unique identifier for the exception. | What It Supports? Starts with a letter (A-Z or a-z) Allows letters, digits, and underscores after the first character Supports single-character variable names Empty trailing characters after the first letter are allowedShape What It Does Not Support? Does not start with a letter Contains unsupported special characters Empty strings are still invalid |
| Exception* | Select the exception from the drop-down. | The exceptions created in the Workflow Exceptions folder are available in the drop-down. |
| Handler | Select the handler that is filtered based on the selected exception. | The handlers created in Workflow Exceptions are available in the drop-down. |
Note: Note: An asterisk (*) denotes that the property is mandatory for adding an exception.
Constructs
The following are the constructs available in an activity:
| Constructs in Activity |
|---|
| If |
| Assignment |
| Foreach |
| Break |
| Continue |
| While |