Previous Next JavaScript must be enabled to correctly display this content

## 20.1.2 About Workflow Definitions

Workflow Definitions contain information about workflows including parameters, variables, activities, connections, and participants. Workflow definitions exist on the application level in the Shared Components section.

- About Workflow Parameters
  Workflow Parameters pass information into a workflow when a new workflow instance starts.
- About Workflow Variables
  Workflow Variables are specific to a workflow version and can change during the workflow runtime.
- About Workflow Activities
  Workflow Activities specify what happens during each step of a workflow.
- About Workflow Connections
  Workflow Connections link workflow activities and determine the path through the workflow at runtime.
- About Workflow Participants
  Workflow Participants have operational privileges on workflows.

Parent topic: About Workflows

### 20.1.2.1 About Workflow Parameters

Workflow Parameters pass information into a workflow when a new workflow instance starts.

Workflow Parameters are inputs for the workflow that APEX passes to the workflow when a new workflow instance starts. For example, a workflow that approves an employee's request for a new laptop could include parameters like Employee ID and Laptop Type.

Workflow parameters support data types and format masks, and can be based on SQL queries or page items. Workflow parameters can have directions: In, Out, and In/Out. Out and In/Out parameters can only be based on workflow items (variables and parameters). Out parameters can only be set when the workflow is invoked from another workflow. Out parameters can not be set when the workflow is used in a page process.

When the direction is set to In, workflow parameters are read-only. When the direction is set to In/Out or Out, the workflow parameter can be updated while the workflow instance is running.

Parent topic: About Workflow Definitions

### 20.1.2.2 About Workflow Variables

Workflow Variables are specific to a workflow version and can change during the workflow runtime.

Workflow Variables are inputs for the workflow that are specific to the workflow version. Workflow variables support data types and format masks. They can be based on SQL queries, expressions, function bodies, or workflow parameters. Workflow variables can initiate as a `NULL` value.

The value of a workflow variable can change during the workflow runtime. Workflow variables update due to:

- the result of a completed workflow activity

  Note:

  Workflow variables should not be set by workflow activities in parallel flow branches. If the same variable is updated by activities in different parallel flow branches, the behavior is not deterministic, and the last activity to update the variable sets the value. Workflow variables cannot be nullified in an activity of a parallel branch.
- the workflow administrator explicitly calling the `apex_workflow.update_variables()` API
- the workflow administrator updating the variable from the workflow details page

  Note:

  If the workflow variable is a `CLOB` datatype and the value exceeds the `VARCHAR2` limit, use the `apex_workflow.update_variables()` API instead of the details page.

Parent topic: About Workflow Definitions

### 20.1.2.3 About Workflow Activities

Workflow Activities specify what happens during each step of a workflow.

A Workflow Activity is a logical step in a workflow. Each workflow activity requires human or machine resources to support workflow execution. For example, a workflow activity could programmatically evaluate data from a table in order to conditionally branch an activity, or an activity could request input from a workflow participant.

Workflow Activities, Plugins, and Properties

In APEX, each workflow activity corresponds to a process type plugin. All workflows have:

- exactly one Start Activity at the beginning
- at least one End Activity at the end
- support for existing process type plug-ins, including Execute Code, Send E-Mail, Human Task - Create, Send Push Notification, Invoke API, and Server Side Geocoding (supported only on Oracle Autonomous Database)
- support for workflow-specific process type plug-ins, including Workflow Start, Workflow End, Wait, Workflow Switch, and Invoke Workflow

Each workflow activity, regardless of type, has the following common properties:

- Due On - Specifies activity timeouts. Wait activities have their own timeout specifications
- Additional Workflow Data - Specifies a SQL Query. The workflow can use the columns from the query as bind variables or substitution strings in the activity
- Sequence - The sequence in which the workflow appears in the Designer Tree. The sequence and the placement of the activity in the workflow are not the same, and changing the sequence of an activity does not move the activity earlier in the workflow
- Label - A display name that appears in the workflow diagram

In addition to the activity properties, a workflow activity may also have one or more Activity Variables. Activity variables also have their own properties, and can capture information about the workflow activity that can be used later on in the workflow.

You can also configure activities for error handling. Error handling is not managed on the activity itself—instead, configure Error Connections from the activity that dictate how specific errors are resolved. For more on configuring error connections, see Adding a Workflow Connection.

Parallel Flow

Workflow activities can run in sequence or in parallel. Consider a simple vacation request, where management approves the request for time off, and then the team calendar is updated with the approved vacation time. This can be achieved with a sequential workflow. Now, consider an employee onboarding process, where the employee accepts the offer, and then multiple departments have simultaneous tasks to complete before the new employee's start date. This can be achieved with a parallel workflow, which allows workflow activities in parallel branches to execute at the same time.

A parallel flow activity comprises two or more branches with one or more activities in each branch. A branch cannot start with a workflow start activity, and cannot end with a workflow end activity. A parallel flow activity cannot be inside another parallel flow activity.

A parallel flow activity might have a deadline configured. 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 modeled together with the parallel flow activity if the workflow must continue after the deadline of the parallel flow activity is reached.

A parallel flow activity might specify one or more activity variables or additional data. This data and the values of the parallel flow activity variables become available in all activities in all branches of the parallel flow activity.

Parent topic: About Workflow Definitions

### 20.1.2.4 About Workflow Connections

Workflow Connections link workflow activities and determine the path through the workflow at runtime.

A Workflow Connection is a link between two workflow activities. Workflow connections determine the path through a particular workflow at runtime.

There are two types of connections: branches and transitions.

Branches

Branches are connections from switch activities. Switch activities split the workflow path from one activity to multiple other activities depending on the result of the condition specified in the switch activity. Each of these splits is called a branch. For example, a True False Check switch has one branch if the condition specified in the activity evaluates as true, and one branch if the condition specified in the activity evaluates as false.

Transitions

Transitions are connections that go directly from one activity to another. For example, a Start activity can transition directly to an Execute Code activity. There are three types of transitions that connect activities in a workflow.

Normal

  The default connection between two workflow activities. Every workflow activity must have at least one incoming and one outgoing normal connection with the exception of start activities, which cannot have an incoming connection, and end activities, which cannot have an outgoing connection.

Timeout

  Every activity can have a timeout connection specified if there is already a timeout value in the deadline section of the activity properties. The only exception is the wait activity, since it already has its own timeout specification and cannot have another timeout connection stemming from it.

Error

  Every activity can have one or more error connections specified. Each error connection specifies the SQL errorcode. When an error occurs during runtime, the workflow executes the target activity of the error connection instead of going into a faulted state.

Parent topic: About Workflow Definitions

### 20.1.2.5 About Workflow Participants

Workflow Participants have operational privileges on workflows.

Workflow Participants are APEX users with operational privileges over a workflow. Workflow participants are associated with a specific workflow version. They are not represented in the workflow diagram, but they are visible in the Workflow Designer Tree.

You can start an In Development workflow without adding participants. However, in order to start an Active workflow, you must specify participants.

You can specify Workflow Owners and Workflow Administrators in the tree.

Workflow Owner

  Can start and terminate an instance of the workflow. Can retry a faulted workflow.

Workflow Administrator

  Can start, terminate, suspend, resume, and retry a workflow instance. Can update variable values of a workflow instance.

An APEX user does not need to be a workflow participant to start a workflow. The user who starts a workflow is known as the Workflow Initiator. Initiators can terminate workflow instances, but only for workflows they initiated.

Parent topic: About Workflow Definitions