Context Variables Reference¶
Each time the framework calls your workflow, it provides context variables: what kind of request this is, who the user is, what they asked, which action they clicked and what extra data is available.
All variables are under the $context root, in two namespaces:
| Namespace | Provided by | Contains |
|---|---|---|
$context.$app.* |
Agentic App framework | Message hint, action payload, user and app context, attachments, communication parameters, panel name, agent list |
$context.$system.* |
AI Agent Studio runtime | Input message, chat history |
$inputMessage must be passed explicitly
$context.$system.$inputMessage holds the current request's user message or app-supplied input. Depending on the stage, that can include Builder instructions, a forwarded action command, communication content, or a form submission. Read other context from its named variables. Internal nodes don't receive the input automatically; wire it into every node that needs it.
Variable reference¶
| Variable | Type | Available | Description |
|---|---|---|---|
$context.$app.$OraMessageHint |
String | Always | The request type. See Message Hints. |
$context.$system.$inputMessage |
String | Request-dependent | Current message, app instructions, forwarded command/content, or oraFormSubmit envelope |
$context.$system.$chatHistory |
String | Query |
Previous Ask Oracle turns |
$context.$app.$OraAction |
Stage-dependent | Action/capability flows | Action context on configured action paths; stored capability name for InvokeCapability |
$context.$app.$OraUserContext |
Object | Always | Current user identity (see below) |
$context.$app.$OraAppContext |
String | When set | Launch context from a URL parameter, app-to-app navigation or Switch App Context |
$context.$app.$OraAttachments |
Map | Query flows with attachments | Uploaded files (empty if none) |
$context.$app.$OraCommParamsToFill |
Array | FillParameters |
Communication parameters to fill, each with id and title |
$context.$app.$OraCommNonTemplateParamList |
— | SendCommunication |
Non-template parameters for the sending flow |
$context.$app.$OraPanelName |
String | AdditionalContent |
Name of the requested panel |
$context.$app.$OraAgentList |
— | Optional | Agents available in the app (useful for dedicated Query agents) |
Fill-parameters spelling
Use $context.$app.$OraCommParamsToFill (singular Comm). Older material also uses $OraCommsParamsToFill; use the name supported by your workflow runtime.
Hint × variable matrix¶
| Hint | $inputMessage |
$chatHistory |
$OraAction |
$OraUserContext |
$OraAppContext |
$OraAttachments |
Params-to-fill | Non-template params | $OraPanelName |
|---|---|---|---|---|---|---|---|---|---|
InitTitle |
● | ● | ○ | ||||||
InitSubtitle |
● | ● | ○ | ||||||
Summary |
● | ● | ○ | ||||||
InitDisplay |
● | ● | ○ | ||||||
InitActions |
● | ● | ○ | ||||||
InitCommunications |
● | ● | ○ | ||||||
Query |
● | ● | ● | ○ | ○ | ||||
InvokeAction |
● | ● | ● | ○ | |||||
FillParameters |
● | ● | ○ | ● | |||||
SendCommunication |
● | ● | ○ | ● | |||||
AdditionalContent |
● | ● | ○ | ● |
● = relevant / populated · ○ = populated when present
Details¶
$OraUserContext¶
Always available. Use it to personalize content and to scope data to the user.
{
"fullName": "Meg Patel",
"userId": "mpatel01",
"userName": "meg.patel@example.com",
"guId": "8f3c2a71d0b24e5f"
}
| Property | Use for |
|---|---|
fullName |
Greetings in InitSubtitle / Summary ("Good morning, Meg") |
userId |
Queries that filter by user |
userName |
System lookups (usually email format) |
guId |
Matching identity across systems |
$OraAppContext¶
A string, usually JSON, that sets the app's starting scope. It comes from one of these sources:
- URL:
https://<host>/…/app/APP_CODE?appContext={"orderId":"12345","priority":"high"} - App-to-app navigation: the context data in
ora.App.launch("APP_CODE", contextData)or a Navigate to App step - Switch App Context: an action step
Parse it in a Code node and add the values to downstream prompts.
$OraAction¶
Set when the user triggers ora.Invoke("command", "context"). The second argument becomes the action payload used by configured steps. Prefer an object payload for new app actions; verify the representation on the receiving workflow path.
When a step sends a command to an agent, also read $context.$system.$inputMessage for the forwarded command or content. Which values reach the handler depends on the configured steps; see Receiving action commands.
ora.Invoke("refreshAllAgents") → no payload
ora.Invoke("viewOrderDetails", "ORDER-12345") → "ORDER-12345"
ora.Invoke("processItem", "{\"id\":\"123\"}") → "{\"id\":\"123\"}"
$chatHistory¶
Use $context.$system.$chatHistory. $OraChatHistory is deprecated. For Query, pass both the history and the current $inputMessage.
$OraAttachments¶
Only usable if the agent team has the MultiFileProcessor tool. Without it, the agent sees attachment metadata but can't read file contents.
Code node pattern¶
// Read the routing key first
const hint = $context.$app.$OraMessageHint;
// Parse JSON payloads defensively
function safeParse(s) {
if (!s) return null;
try { return JSON.parse(s); } catch (e) { return { raw: s }; }
}
const action = safeParse($context.$app.$OraAction);
const appCtx = safeParse($context.$app.$OraAppContext);
const user = $context.$app.$OraUserContext || {};
return {
hint,
recordId: action && (action.id || action.raw),
scope: appCtx,
greetingName: (user.fullName || "").split(" ")[0]
};
Note
Code node syntax and return conventions depend on your AI Agent Studio release. Treat this as a pattern, not code to paste.
Practical tips¶
- Read
$OraMessageHintfirst. It decides which other variables matter. - Parse JSON defensively.
$OraActionand$OraAppContextmay be malformed. - Personalize with
fullName, and scope queries withuserId. - Pass
$chatHistoryfor conversational continuity. - Test each hint on its own in Preview and check that the variables arrive.
Additional context variables¶
| Variable | Relevant flow | Meaning |
|---|---|---|
$context.$app.$OraAppDisplayDiscriminator |
InitDisplay |
Identifies the requesting top-level panel when a workflow is shared |
$context.$app.$OraAskOracleContext |
Query | Additional contextual information for the current ask flow |
$context.$app.$OraUiContext |
App requests, including startup panels | UI context sent by the runtime |
$context.$app.$OraParentConversationId |
Ask Oracle | Parent conversation identifier |
$context.$app.$OraRequestDefaultAppContext |
InitContextSuggestions |
Whether the workflow may return a default app context |
$context.$app.$OraQueryFilter |
QueryFilterValues |
Object with categoryId and searchString; initial search is empty |
$context.$app.$OraActionPayload |
InvokeCapability |
Capability input payload; $OraAction holds the unqualified capability name |
The earlier hint matrix covers the original ten stages. For newer feature paths, use this table together with Message Hints.
For direct workflow capability calls, read $context.$triggers.isCapabilityCall and $context.$triggers.CAPABILITY.$input.capabilityName / capabilityPayload. These trigger values are distinct from the app InvokeCapability route.