Previous Next JavaScript must be enabled to correctly display this content

## 20.2.3 Creating a Workflow Activity

Create a workflow activity by right-clicking the workflow version and selecting Create Activity.

A workflow activity specifies what kind of work APEX performs when the workflow arrives at that activity.
You can only create a workflow activity if the workflow is in development. You cannot create a workflow activity if the workflow is active.

To create a workflow activity:

1. Choose one of the following options:
   - Right-click on the workflow version and choose Create Activity.
   - Drag and drop a specific activity from the Activity Palette into the Diagram Builder.

     Tip:

     You can drop an activity on an existing activity to automatically place the new activity next in the workflow execution order. You can also drop an activity on a connection to place the new activity between the original source and the target of the connection.
   - Right-click an existing activity in the workflow tree and select Create Activity Below.

     Tip:

     The new activity is not connected to any existing activities. You must explicitly create connections to other activities.
   - Right-click an existing activity in the workflow tree and select Create Activity After.

     Tip:

     The new activity is connected to the existing activity. If the existing activity was connected to another activity, the new activity replaces that connection.
   By default, the new activity type is Execute Code.
2. Enter the activity Name.
   The name displays in the workflow tree and in the Diagram Builder. The activity name must be unique for the workflow.
3. Select the activity Type:
   - Custom Process Type Plug-in - An activity that uses an existing process type plug-in. See Adding a Custom Process Type Plug-in as an Activity.
   - Execute Code - An activity that executes the entered code.
   - Generate Text with AI - An activity that uses an existing AI configuration to generate text. See Adding a Workflow Generate Text with AI Activity,
   - Human Task - Create - An activity that links to an existing task definition. See Adding a Workflow Human Task Activity.
   - Invoke API - An activity that invokes an API.
   - Invoke Workflow - An activity that invokes another workflow in the current application. See Adding an Invoke Workflow Activity.
   - Parallel Flow - An activity that creates multiple branches that execute activities in parallel. See Adding a Parallel Flow Activity.
   - Send Email - An activity that sends an email.
   - Send Push Notification - An activity that sends a push notification.
   - Switch - An activity that defines branches in the workflow. See Adding a Workflow Switch Activity.
   - Wait - An activity that represents a pause in the workflow. See Adding a Workflow Wait Activity.
   - Workflow End - An activity that ends the workflow or a particular branch of a workflow. See Adding a Workflow End Activity.
   - Workflow Start - The single activity that starts the workflow. See Adding a Workflow Start Activity.
4. Fill in the remaining settings for the activity type.
5. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
6. (Optional) Under Deadline, configure Due On Type.
7. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of activities in the workflow execution chain.
8. Continue configuring the activity:
   - Duplicate the activity by clicking on the context menu and selecting Duplicate.
   - Configure Workflow Connections by clicking the context menu and selecting Create Connection. For more on workflow connections, see Adding a Workflow Connection.
   - Create an Activity Variable by clicking the context menu and selecting Create Activity Variable. For more on activity variables, see Defining an Activity Variable.
   - Create another activity connected to this activity by clicking the Connect tool on any side of the existing activity and selecting the type for the new activity.
9. Click Show Messages to view and fix errors.
   The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
10. Click Save to save your changes.

- Adding a Workflow Start Activity
  A Start activity begins a workflow.
- Adding a Workflow End Activity
  An end activity ends a workflow or a workflow branch.
- Adding a Workflow Switch Activity
  A switch activity defines conditional branches in your workflow.
- Adding a Workflow Wait Activity
  A Wait activity pauses workflow execution.
- Adding a Workflow Human Task Activity
  A Human Task - Create activity creates a human task using an existing task definition.
- Adding a Workflow Generate Text with AI Activity
  A Generate Text with AI activity generates text with a previously-configured AI service.
- Adding a Custom Process Type Plug-in as an Activity
  A custom process type plugin uses a custom plugin as an activity.
- Adding an Invoke Workflow Activity
  An invoke workflow activity calls another workflow in the same application.
- Adding a Parallel Flow Activity
  A parallel flow activity creates multiple branches that execute activities in parallel.
- Defining an Activity Variable
  Add an activity variable by right-clicking the activity in the workflow tree and selecting Create Activity Variable.

Parent topic: Creating a Workflow

### 20.2.3.1 Adding a Workflow Start Activity

A Start activity begins a workflow.

There can only be one start activity in a workflow.

To create a workflow start activity:

1. Right-click on the workflow version and select Create Activity.
   You can also drag the Workflow Start activity from the Activities Palette into the Diagram Builder.
2. Enter the activity Name.
   The name displays in the workflow tree and in the workflow diagram builder. The activity name must be unique for the workflow.
3. Set the Type to Workflow Start.
4. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
5. (Optional) Under Deadline, configure Due On Type.
6. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.
7. Continue configuring the activity:
   - Configure Workflow Connections by clicking the context menu and selecting Create Connection. For more on workflow connections, see Adding a Workflow Connection.
   - Create an Activity Variable by clicking the context menu and selecting Create Activity Variable. For more on activity variables, see Defining an Activity Variable.
   - Create another activity connected to this activity by clicking Connect on any side of the existing activity and selecting the type for the new activity.
8. Click Show Messages to view and fix errors.
   The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
9. Click Save to save your changes.

A workflow can only have one Start Activity. The Start Activity cannot have any incoming connections.

Parent topic: Creating a Workflow Activity

### 20.2.3.2 Adding a Workflow End Activity

An end activity ends a workflow or a workflow branch.

To create a workflow end activity:

1. Right-click on the workflow version and select Create Activity.
   You can also drag the Workflow End activity from the Activities Palette into the Diagram Builder.
2. Enter the activity Name.
   The name displays in the workflow tree and in the workflow diagram builder. The activity name must be unique for the workflow.
3. Set the type to Workflow End.
4. Select the End State:
   - Completed - When the workflow reaches this activity, the workflow ends with the Completed state.
   - Terminated - When the workflow reaches this activity, the workflow ends with the Terminated state. This state indicates that something unexpected happened in the workflow.
5. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
6. (Optional) Under Deadline, configure Due On Type.
7. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.
8. Continue configuring the activity:
   - Duplicate the activity by clicking on the context menu and selecting Duplicate.
   - Configure Workflow Connections by clicking the context menu and selecting Create Connection. For more on workflow connections, see Adding a Workflow Connection.
   - Create an Activity Variable by clicking the context menu and selecting Create Activity Variable. For more on activity variables, see Defining an Activity Variable.
9. Click Show Messages to view and fix errors.
   The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
10. Click Save to save your changes.

A workflow can have one end activity or multiple end activities. An end activity does not have any outgoing connections.

Parent topic: Creating a Workflow Activity

### 20.2.3.3 Adding a Workflow Switch Activity

A switch activity defines conditional branches in your workflow.

To create a workflow switch activity:

1. Right-click on the workflow version and select Create Activity.
   You can also drag the Switch activity from the Activities Palette into the Diagram Builder.
2. Enter the activity Name.
   The name displays in the workflow tree and in the workflow diagram builder. The activity name must be unique for the workflow.
3. Set the Type to Switch.
4. Select the switch type:
   - True False - For branches based on a true/false outcome of the switch condition. See Configuring a True False Switch.
   - Check Workflow Variable - For branches based on the value of a workflow variable. See Configuring a Check Workflow Variable Switch.
   - Case - For branches based on the value of a case expression. See Configuring a Case Switch.
   - If Elsif Else - For branches based on the evaluation of more complex conditional expressions. See Configuring an If Elsif Else Switch.
5. Fill in the remaining settings for the activity type.
6. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
7. (Optional) Under Deadline, configure Due On Type.
8. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.
9. Continue configuring the activity:
   - Duplicate the activity by clicking on the context menu and selecting Duplicate.
   - Configure Workflow Connections by clicking the context menu and selecting Create Connection. For more on workflow connections, see Adding a Workflow Connection.
   - Create an Activity Variable by clicking the context menu and selecting Create Activity Variable. For more on activity variables, see Defining an Activity Variable.
   - Create another activity connected to this activity by clicking Connect on any side of the existing activity and selecting the type for the new activity.
10. Click Show Messages to view and fix errors.
    The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
11. Click Save to save your changes.

- Configuring a True False Switch
  A True False switch is based on the result of a single condition that returns a boolean.
- Configuring a Check Workflow Variable Switch
  A Check Workflow Variable switch is based on the value of a workflow variable.
- Configuring a Case Switch
  A Case switch is based on the result of a computation.
- Configuring an If Elsif Else Switch
  An If Elsif Else switch is based on `AND/OR` comparisons between the conditions.

Parent topic: Creating a Workflow Activity

#### 20.2.3.3.1 Configuring a True False Switch

A True False switch is based on the result of a single condition that returns a boolean.

To configure a True False Switch:

1. Set the switch type to True False Check.
2. Set the Condition Type:
   - Rows Returned - Defined by a SQL Query.
   - Rows Not Returned - Defined by a SQL Query.
   - Expression - Defined by an PL/SQL Expression.
   - Function Body - Defined by a PL/SQL Function Body.
   - Workflow Variable = Value - Select the workflow parameters, version variables, or activity variables.
   - Workflow Variable != Value - Select the workflow parameters, version variables, or activity variables.
   - Workflow Variable is NULL.
   - Workflow Variable is NOT NULL.
3. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
4. (Optional) Under Deadline, configure Due On Type.
5. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.

Add the switch branches. To create a new branch:

6. Right-click on the Switch activity in the tree and select Create Connection.
   You can also click the context menu at the bottom right corner of the Switch activity in the Diagram Builder and select Create Connection.
7. In the properties of the Connection, specify the following attributes:
   1. When - Specify whether this connection is for a True, False, or Null value of the condition.
   2. To - Select the target activity that the condition leads to.
8. Click Show Messages to view and fix errors.
   The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
9. Click Save to save your changes.

Parent topic: Adding a Workflow Switch Activity

#### 20.2.3.3.2 Configuring a Check Workflow Variable Switch

A Check Workflow Variable switch is based on the value of a workflow variable.

To configure a Check Workflow Variable Switch:

1. Set the switch type to Check Workflow Variable.
2. For Compare Variable, select the workflow parameter, version variable, or activity variable for the comparison.
3. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
4. (Optional) Under Deadline, configure Due On Type.
5. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.

Add the switch branches. To create a new branch:

6. Right-click on the Switch activity in the tree and select Create Connection.
   You can also click on the menu at the bottom right corner of the Switch activity in the Diagram Builder and select Create Connection.
7. In the properties of the Connection, specify the following attributes:
   1. Operator - From the dropdown, select the appropriate operator.
   2. To - Select the target activity that the condition leads to.
8. Click Show Messages to view and fix errors.
   The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
9. Click Save to save your changes.

Parent topic: Adding a Workflow Switch Activity

#### 20.2.3.3.3 Configuring a Case Switch

A Case switch is based on the result of a computation.

To configure a Case Switch:

1. Set the switch type to Case.
2. Specify the Compare Data Type by selecting the appropriate data type for the result of the case statement or expression.
   Case supports the following data types: `VARCHAR2`, `NUMBER`, `BOOLEAN`, `TIMESTAMP`, `TIMESTAMP WITH TIME ZONE`, `TIMESTAMP WITH LOCAL TIME ZONE`.
3. Specify the Compare Type by selecting either SQL Query, Expression, or Function Body.
4. In the Code Editor, enter the Compare Query.
5. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
6. (Optional) Under Deadline, configure Due On Type.
7. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.

Add the switch branches. To create a new branch:

8. Right-click on the switch activity in the tree and select Create Connection.
   You can also click on the menu at the bottom right corner of the Switch activity in the Diagram Builder and select Create Connection.
9. In the connection properties, specify the following attributes:
   1. Sequence - Specify the sequence. The sequence determines the order that APEX evaluates case branches at runtime.
   2. Operator - Select the branch condition expression.
   3. Value - Specify the value to compare with.
   4. To - Select the target activity the branch leads to.
10. Click Show Messages to view and fix errors.
    The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
11. Click Save to save your changes.

Parent topic: Adding a Workflow Switch Activity

#### 20.2.3.3.4 Configuring an If Elsif Else Switch

An If Elsif Else switch is based on `AND/OR` comparisons between the conditions.

To configure an If Elsif Else switch:

1. Set the switch type to If Elsif Else.
2. (Optional) Under Deadline, configure Due On Type.
3. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.

Add the switch branches. To create a new branch:

4. Right-click on the switch activity in the tree and select Create Connection.
   You can also click on the menu at the bottom right corner of the Switch activity in the Diagram Builder and select Create Connection.
5. In the properties of the connection, specify the following attributes:
   1. Sequence - Specify the sequence. This determines the order that APEX evaluates the branches in at runtime.
   2. Type - From the dropdown, select the appropriate condition that must be satisfied for this branch.
   3. To - Select the target activity the branch leads to.
6. Click Show Messages to view and fix errors.
   The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
7. Click Save to save your changes.

Parent topic: Adding a Workflow Switch Activity

### 20.2.3.4 Adding a Workflow Wait Activity

A Wait activity pauses workflow execution.

A Wait activity pauses workflow execution. The wait state updates in two ways: a Time Out after the specified duration elapses, or a call from `apex_workflow.continue_activity`.

To create a workflow wait activity:

1. Right-click on the workflow version and select Create Activity.
   You can also drag the workflow Wait activity from the Activities Palette into the Diagram Builder.
2. Enter the activity Name.
   The name displays in the workflow tree and in the workflow diagram builder. The activity name must be unique for the workflow.
3. Set the type to Wait.
4. For Timeout Type, specify Static, SQL Query, Expression, or Function Body.
   For Static, use ISO Duration format values.
5. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
6. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.
7. Continue configuring the activity:
   - Duplicate the activity by clicking on the context menu and selecting Duplicate.
   - Configure Workflow Connections by clicking the context menu and selecting Create Connection. For more on workflow connections, see Adding a Workflow Connection.
   - Create an Activity Variable by clicking the context menu and selecting Create Activity Variable. For more on activity variables, see Defining an Activity Variable.
   - Create another activity connected to this activity by clicking Connect on any side of the existing activity and selecting the type for the new activity.
8. Click Show Messages to view and fix errors.
   The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
9. Click Save to save your changes.

Parent topic: Creating a Workflow Activity

### 20.2.3.5 Adding a Workflow Human Task Activity

A Human Task - Create activity creates a human task using an existing task definition.

In order to use a task as part of a workflow, you must already have the task definition configured in the application. For more information on setting up task definitions, see About Task Definitions.

To create a workflow human task activity:

1. Right-click on the workflow version and select Create Activity.
   You can also drag the Human Task - Create activity from the Activities Palette into the Diagram Builder.
2. Enter the activity Name.
   The name displays in the workflow tree and in the workflow diagram builder. The activity name must be unique for the workflow.
3. Set the Type to Human Task - Create.
4. Under Settings, set the Human Task properties:
   1. Definition - Select the Task Definition from the dropdown.
   2. Subject - Set the subject if you want to override the subject from the task definition.
   3. Priority - Set the priority if you want to override the priority from the task definition.
   4. (Approval tasks only) Initiator Can Complete - Set whether the initiator can also complete the task if you want to override this value from the task definition.
   5. Initiator Item - The ID of the user initiating the task. When not specified, this value defaults to the current logged-in user.
   6. Task ID Item - The page item where the ID of the newly created task instance can be stored.
   7. Details Primary Key Item - The workflow item (variable or parameter) pointing to the Primary Key for the system of records that the task definition uses.
   8. (Optional) Outcome - A workflow variable to store the task outcome.
   9. (Optional) Owner - A workflow variable to store the person who approved, rejected, or completed the task.

   Tip:

   When you create a Human Task activity, APEX creates two workflow variables: `TASK_OUTCOME` and `APPROVER`. In the activity settings, you can set the Outcome and Approver attributes to these variables. At runtime, after the task completes, the workflow variable `TASK_OUTCOME` is set to `APPROVED` or `REJECTED` based on the outcome of the task. Subsequent activities in the workflow can use these workflow variables. You can choose to ignore the outcome and approver details from the activity, delete the auto-generated workflow variables, and leave the corresponding task attributes empty.

   For example, a Switch activity that follows a Human Task activity can use the Check Workflow Variable type to look at `TASK_OUTCOME`, and branch the workflow based on `TASK_OUTCOME = APPROVED` and `TASK_OUTCOME = REJECTED`.

   Note that if there are subsequent Human Task activities in the workflow, these workflow variables are not automatically created again. You can choose to re-use the same workflow variables to store the task outcome and actual owner, or you can manually create new workflow variables if you want each Human Task activity outcome stored in a different workflow variable.

5. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
6. (Optional) Under Deadline, configure Due On Type.
7. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.
8. Continue configuring the activity:
   - Duplicate the activity by clicking on the context menu and selecting Duplicate.
   - Configure Workflow Connections by clicking the context menu and selecting Create Connection. For more on workflow connections, see Adding a Workflow Connection.
   - Create an Activity Variable by clicking the context menu and selecting Create Activity Variable. For more on activity variables, see Defining an Activity Variable.
   - Create another activity connected to this activity by clicking Connect on any side of the existing activity and selecting the type for the new activity.
9. Click Show Messages to view and fix errors.
   The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
10. Click Save to save your changes.

Parent topic: Creating a Workflow Activity

### 20.2.3.6 Adding a Workflow Generate Text with AI Activity

A Generate Text with AI activity generates text with a previously-configured AI service.

Before you can add a workflow activity to generate text with AI, you must complete the steps described in About Including Generative AI in Applications. Failure to create a Generative AI Service or edit the application, AI attributes results in an error.

To create a workflow Generate Text with AI activity:

1. Right-click on the workflow version and select Create Activity.
   You can also drag the Generate Text with AI activity from the Activities Palette into the Diagram Builder.
2. Enter the activity Name.
   The name displays in the workflow tree and in the workflow diagram builder. The activity name must be unique for the workflow.
3. Set the Type to Generate Text With AI.
4. Set the activity properties:
   1. Generative AI, Configuration - Select the AI configuration from the dropdown.
   2. Input Value, Type - Select `Item`.
   3. Input Value, Item - Enter the item used to set the user input.
   4. Use Response, Item - Enter the item used as the destination for the response value that the AI service returns.

      Tip:

      If this item is a Workflow Variable, set the datatype to `CLOB` to ensure it can handle to response from the Generative AI service.
5. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
6. (Optional) Under Deadline, configure Due On Type.
7. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.
8. Continue configuring the activity:
   - Duplicate the activity by clicking on the context menu and selecting Duplicate.
   - Configure Workflow Connections by clicking the context menu and selecting Create Connection. For more on workflow connections, see Adding a Workflow Connection.
   - Create an Activity Variable by clicking the context menu and selecting Create Activity Variable. For more on activity variables, see Defining an Activity Variable.
   - Create another activity connected to this activity by clicking Connect on any side of the existing activity and selecting the type for the new activity.
9. Click Show Messages to view and fix errors.
   The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
10. Click Save to save your changes.

Parent topic: Creating a Workflow Activity

### 20.2.3.7 Adding a Custom Process Type Plug-in as an Activity

A custom process type plugin uses a custom plugin as an activity.

To configure the process type plug-in for workflow use:

1. Navigate to the Shared Components page:
   1. On the Workspace home page, click App Builder.
   2. Select an application.
   3. On the Application home page, click Shared Components.

      The Shared Components page appears.

2. Under Other Components, click Plug-ins.
3. Click the plug-in you want to edit.

   The Edit page appears.

4. In Supported For, enable Workflow Activities.

To configure the workflow to wait on this process and only progress after the process completes:

5. Under Standard Attributes, select Wait for Completion.
6. (Optional) In Callbacks, specify the Completion function for the process.
   When the process completes and calls back into the workflow using `apex_workflow.continue_activity`, the workflow engine executes the Completion function before continuing with the rest of the workflow activities. Refer to APEX_WORKFLOW in Oracle APEX API Reference to learn more about the `continue_activity()` API.
7. (Optional) In Callbacks, specify the Termination function for the process.
   Termination functions are useful if you want to free up resources held by your process if the workflow is terminated. You can only add a termination function if you have already selected Wait For Completion.

To add the custom process type plug-in to the workflow:

8. Right-click on the workflow version and select Create Activity.
9. Enter the activity Name.
   The name displays in the workflow tree and in the workflow diagram builder. The activity name must be unique for the workflow.
10. Set the Type to the name of your plug-in. Available custom process plug-ins display under the Application Components heading.
    You can also drag the custom process type plug-in activity from the Activities Palette into the Diagram Builder.
11. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
12. (Optional) Under Deadline, configure Due On Type.
13. Under Layout, set the sequence.
    The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.
14. Continue configuring the activity:
    - Duplicate the activity by clicking on the context menu and selecting Duplicate.
    - Configure Workflow Connections by clicking the context menu and selecting Create Connection. For more on workflow connections, see Adding a Workflow Connection.
    - Create an Activity Variable by clicking the context menu and selecting Create Activity Variable. For more on activity variables, see Defining an Activity Variable.
    - Create another activity connected to this activity by clicking Connect on any side of the existing activity and selecting the type for the new activity.
15. Click Show Messages to view and fix errors.
    The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
16. Click Save to save your changes.

Parent topic: Creating a Workflow Activity

### 20.2.3.8 Adding an Invoke Workflow Activity

An invoke workflow activity calls another workflow in the same application.

The invoked workflow must already be configured for the application.

To add an invoke workflow activity:

1. Right-click on the workflow version and select Create Activity.
   You can also drag the Invoke Workflow activity from the Activities Palette into the Diagram Builder.
2. Enter the activity Name.
   The name displays in the workflow tree and in the workflow diagram builder. The activity name must be unique for the workflow.
3. Set the Type to Invoke Workflow.
4. Under Settings, set the Invoke Workflow properties:
   1. Definition - Select the Workflow Definition from the dropdown.

      Note:

      A workflow cannot invoke itself or any of its caller workflows. This avoids cyclic dependency.
   2. Initiator Item - Provide an optional workflow variable or parameter that specifies the initiator of the invoked workflow.
      If Initiator Item is set, the initiator of the invoked workflow is the value of this item. Otherwise, the initiator of the invoked workflow is the initiator of the parent workflow.
   3. Details Primary Key Item - The workflow item (variable or parameter) pointing to the Primary Key for the system of records that the invoked workflow uses.
   4. Workflow ID Item - The workflow item where the ID of the newly invoked workflow instance is stored.
   5. Wait for Completion - Turn this switch On if the workflow waits for the invoked workflow instance to complete before progressing to the next activity. Turn this switch Off if the workflow progresses to the next activity without waiting for the invoked workflow instance to complete.
      This switch is turned on by default.
   6. Retry Point - Defines the point where an invoked workflow is retried if it faults. Resume retries the invoked workflow from the faulted activity. Start Over terminates the faulted instance of the invoked workflow and starts a new instance.
      Start Over is only applicable when the Retry operation is performed on the faulted parent workflow instance.

      Note:

      Retry Point is only applicable for invoked workflows with Wait for Completion set to `On`.
5. Set the values for the parameters of the invoked workflow:
   1. Under the Invoke Workflow activity, expand the Parameters region to display the parameters of the invoked workflow.
   2. Ignore Output - Specify whether the parameters for Out and In/Out should be ignored. By default, Ignore Output is turned on. If Ignore Output is turned off, then the value can only be set to an item (parameter, variable, or activity variable) of the current workflow.

   Note:

   If a workflow parameter is set to `Required` and its Value Type is set to `null`, using this workflow in an Invoke Workflow activity throws an exception when the Invoke Activity is executed at runtime.
6. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
7. (Optional) Under Deadline, configure Due On Type.
8. Under Layout, set the sequence.
   The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.
9. Continue configuring the activity:
   - Duplicate the activity by clicking on the context menu and selecting Duplicate.
   - Configure Workflow Connections by clicking the context menu and selecting Create Connection. For more on workflow connections, see Adding a Workflow Connection.
   - Create an Activity Variable by clicking the context menu and selecting Create Activity Variable. For more on activity variables, see Defining an Activity Variable.
   - Create another activity connected to this activity by clicking Connect on any side of the existing activity and selecting the type for the new activity.
10. Click Show Messages to view and fix errors.
    The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
11. Click Save to save your changes.

Parent topic: Creating a Workflow Activity

### 20.2.3.9 Adding a Parallel Flow Activity

A parallel flow activity creates multiple branches that execute activities in parallel.

To add a parallel flow activity:

1. Right-click on the workflow version and select Create Activity.
   You can also drag the Parallel Flow activity from the Activities Palette into the Diagram Builder.
2. Enter the activity Name.
   The name displays in the workflow tree and in the workflow diagram builder. The activity name must be unique for the workflow.
3. Set the Type to Parallel Flow.
4. Click the arrow to expand the activity.
   By default, there are two branches. Each branch is populated with an Execute Code activity.

To add a new branch:

5. Click the activity menu and select Create Branch.

To name a branch:

6. Select the branch in the Workflow Tree or the Workflow Diagram Builder.
7. Under Identification, enter the branch Name.

To move a branch left or right:

8. Click the branch menu and select Move Branch right or Move Branch left.

To continue configuring the branch:

9. Add activities to the branch.

   Tip:

   Branches cannot start with a Workflow Start activity and cannot end with a Workflow End activity. You cannot add a Parallel Flow activity within a branch.
10. (Optional) Under Additional Data, specify a SQL Query to read additional data. For more information, see item-level help.
11. (Optional) Under Deadline, configure Due On Type.

    Tip:

    When the deadline of a parallel flow activity is reached, all activities in all branches of the parallel flow activity terminate. A Timeout transition might be modelled together with the parallel flow activity if the workflow must continue after the deadline of the parallel flow activity is reached.
12. Under Layout, set the sequence.
    The sequence determines where the activity displays in the workflow tree. The sequence does not impact the order of the activities in the workflow execution chain.
13. Continue configuring the activity:
    - Duplicate the activity by clicking on the context menu and selecting Duplicate.
    - Configure Workflow Connections by clicking the context menu and selecting Create Connection. For more on workflow connections, see Adding a Workflow Connection.
    - Create an Activity Variable by clicking the context menu and selecting Create Activity Variable. For more on activity variables, see Defining an Activity Variable.
    - Create another activity connected to this activity by clicking Connect on any side of the existing activity and selecting the type for the new activity.
14. Click Show Messages to view and fix errors.
    The Show Messages icon indicates whether there are any workflow modeling or workflow configuration errors. When you click the icon, APEX displays the list of errors. You can click on an individual error to focus on that activity in the workflow. Note that you cannot save the workflow until you address any errors.
15. Click the arrow to collapse the parallel activity and continue editing the rest of the workflow.

    Tip:

    To edit parallel flow branches, expand the activity. When the parallel flow activity is expanded, all other activities in the Diagram Builder move to the background and cannot be edited. To edit the rest of the workflow, collapse the parallel flow activity in the Diagram Builder. All parallel flow activities must be collapsed in order to edit the workflow.
16. Click Save to save your changes.

Parent topic: Creating a Workflow Activity

### 20.2.3.10 Defining an Activity Variable

Add an activity variable by right-clicking the activity in the workflow tree and selecting Create Activity Variable.

To add a workflow activity variable:

1. Right-click on the activity in the workflow tree and select Create Activity Variable.
2. Fill in the properties for the variable:
   1. Static ID - The unique name of the variable.
   2. Label - The user-friendly label for the variable.
   3. Data Type - Select from `VARCHAR2`, `TIMESTAMP`,`TIMESTAMP WITH LOCAL TIME ZONE`, `TIMESTAMP WITH TIME ZONE`, `NUMBER`, `BOOLEAN`, and `CLOB`.
   4. Value Type - The type of value for the variable.
   5. Value Language - Language, if applicable.
   6. (Item only) Item - The workflow parameter, version variable, or activity variable.
   7. (Boolean only) Format Mask - If applicable, fill in the variable or parameter value used to determine the values.

Parent topic: Creating a Workflow Activity