25.1.7 Defining Parameters and Variables

Use parameters and variables for values a workflow cannot query or must capture at a point in time.

Workflow parameters and variables are a convenient way to persistently store values unique to a workflow instance. Parameters get their value at instance start time and are read-only during the flow. In contrast, your workflow activities can both read and change the value of variables. So one activity can store results in a variable that a later activity can reference or modify. The APEX engine manages their storage automatically.

You define parameters at the workflow definition level, while you specify variables on the workflow version level. While formally called version variables, often workflow variable or just variable are clear alternatives. While local PL/SQL variables are transient values available only within the scope you declare them, workflow variables are available from any activity for the life of the workflow.

Most workflows configure an Additional Details table or query at the workflow level. When combined with the Details Primary Key value passed in when starting the workflow instance, this makes the values of Additional Data columns available anywhere in the flow using :NAME, &NAME. or NAME syntax. Activities can also use the value of the additional data table's primary key column to query other necessary data the process requires by defining an activity-level Additional Details query.

However, if a workflow needs an input value that you cannot query from a table, you can define any number of parameters and variables. When considering whether to add a workflow parameter or variable, ask yourself:
  • Can I query the value from a table in my data model?
    • Yes: retrieve it in the workflow Additional Data query if many activities need it, or in an activity Additional Data query otherwise.
    • No: it's a good candidate to accept as a parameter or to compute as a variable
  • Do I need to store a point in time value used for a calculation in this flow since it might change?
    • Yes: it's a good candidate for a workflow variable
    • No: retrieve it in the workflow Additional Data query if many activities need it, or in an activity Additional Data query otherwise.

Tip:

Both parameter and variables values appear for any instance in the workflow detail page you can generate from the Create Page Wizard. When necessary to fix a problem with a particular flow, that workflow instance's administrator can also modify variable values from this page.