Workflow Substitution Variables
OneStream provides substitution variables that resolve to the current workflow context at runtime. These variables let you write generic Business Rules, Transformation Rules, and Dashboard expressions that automatically adapt based on which Workflow Profile, Scenario, and Time period the user (or batch process) is operating in. Instead of hard-coding dimension member names into your rules, you reference the workflow variable and let the engine fill in the correct value.
Variable Reference
| Variable | Resolves To | Example Value |
|---|---|---|
| WF | Workflow Scenario/Time for POV expressions (e.g. T#WF) — not an Entity | (used as T#WF) |
| WFProfile | Name of the current Workflow Profile | Revenue_Import |
| WFProfileIndex | Index of the current profile in the hierarchy | 3 |
| WFScenario | Name of the current Scenario member | Actual |
| WFTime | Name of the current Time member | 2024M6 |
| WFCube | Name of the current Cube | MainCube |
These are substitution tokens resolved by the OneStream substitution engine wherever it runs — parameter values, POV expressions (
T#WF), Transformation Rule expressions, Cube View and Dashboard/XFBR string expressions, and Data Management step parameters. There is no GetWorkflowSubstitutionVariable BRApi that returns them by name; you either use the token inside a string the engine resolves, or read the workflow context directly from the workflow APIs (shown below).Using Variables in Business Rules
Inside a Business Rule you don't fetch a substitution token by name — you read the current workflow context from the workflow APIs, then branch on it.
BRApi.Workflow.General.GetWorkflowUnitPk(si) returns the workflow POV (profile, scenario, time, and workflow keys); resolve the member keys to names with BRApi.Finance.Members.GetMemberName.Using Variables in Transformation Rules
Transformation Rules run during the IVL (Import, Validate, Load) pipeline and have full access to workflow substitution variables. A common pattern is routing data to different accounts based on the Scenario — for example, mapping a source "Revenue" line to
A#GLRevenue for Actual but to A#PlanRevenue for Budget.The variables are resolved before the transformation expression is evaluated, so you can use them directly in conditional mapping expressions. If a Transformation Rule needs to apply different account mappings depending on whether the load is for Actual or Forecast, it reads
WFScenario and branches accordingly — one rule handles every scenario.Using Variables in Dashboard Expressions
Dashboard parameters and XFBR string functions can reference workflow variables to build context-aware displays. Two common patterns:
- Dynamic labels — Display the active context in report headers (e.g., "Revenue Report — Actual 2024M6") by reading
WFScenarioandWFTimeand concatenating them into a label string. - Data Adapter filtering — Pass
WFScenarioorWFTimeinto a Data Adapter expression so the grid or chart automatically filters to the user's current workflow context without requiring manual parameter selection.
Conditional Logic Based on WFScenario
A practical pattern is using
WFScenario in a Select Case / switch block to apply entirely different calculation models per scenario. This keeps all logic in a single Business Rule while still allowing each scenario to have its own formula.Related Content
- Workflow Engine Overview — architecture and core concepts
- Getting Started with Business Rules — foundational patterns for writing rules
- Workflow Status and Locking — querying workflow state programmatically
- Confirmation and Certification — the certification pipeline