Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Localize/lang/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@
"5qzZMo": "Loading...",
"5rljf7": "Discovery Panel",
"5rqV2M": "Failed",
"5sZLU4": "Apply",
"5szzYP": "Use this template",
"5td/Ux": "Returns a single object containing all properties from the input objects. If both objects have the same property, the property from the second object appears in the final result.",
"5wYM6C": "When an evaluation or assessment process starts",
Expand Down Expand Up @@ -508,6 +509,7 @@
"7ZR1xr": "Add an action",
"7aJqIH": "Optional. The locale to be used when formatting (defaults to 'en-us').",
"7adnmH": "Back to template library",
"7bEIoW": "This host does not enable editing connection expressions. The existing expression is preserved.",
"7bhWPe": "A project with this name already exists in the workspace.",
"7cPLnJ": "Do you want to stop the agent chat? This will cancel the workflow.",
"7fI0ys": "Refreshing...",
Expand Down Expand Up @@ -672,6 +674,7 @@
"Aid5oX": "Handoff description",
"Ak2Lka": "Not connected to",
"AkKqDo": "Built-in Tools",
"Aks6v3": "Connection mode",
"AlPxuK": "Description",
"AlWFOS": "Collapse chat panel",
"Alq4/3": "Hybrid connector",
Expand Down Expand Up @@ -803,6 +806,7 @@
"DGMwU4": "Use sample payload to generate schema",
"DGPz3M": "Copied!",
"DHI56r": "Rules engine location",
"DI8VPY": "Connections selected at runtime",
"DIDL6K": "Standard logic app",
"DIH5g2": "Add knowledge sources to build a knowledge base that the agent uses to generate accurate, context-aware responses and insights.",
"DIwFTo": "To generate and test with the latest XSLT, please save the map first.",
Expand Down Expand Up @@ -890,6 +894,7 @@
"F3IDl8": "Required. The number of a specified time unit to add.",
"F3q0Hk": "Cannot paste actions below agents in agent to agent workflows",
"F67pEe": "Waiting",
"F6vqih": "Connection expression",
"F83QRP": "On a schedule",
"F9dR1Q": "Add",
"F9yRDC": "Method",
Expand Down Expand Up @@ -1157,6 +1162,7 @@
"Kv+Pa3": "Testing",
"KwGA+K": "Select a Function App resource",
"KwYMAL": "Stop chat",
"Kx/APX": "Connection expression setup did not finish. Check the design-time connection and try again.",
"L+PY+j": "Required. The number of objects to take from the Collection. Must be a positive integer.",
"L0UAzs": "Returns the day of week component of a string timestamp",
"L2xC0I": "Set up your knowledge base and add sources that the agent will reference for accuracy.",
Expand Down Expand Up @@ -1292,6 +1298,7 @@
"NWxGWN": "Enter unique property name",
"NaW0ga": "This workflow supports the following states. The state determines how data is managed and retained during execution of workflows.",
"Nbl3zN": "Enter a description of the output",
"Ndfl+w": "Enter a valid workflow expression, for example @parameters('connectionName'). Escaped text starting with @@ is not an expression.",
"NfFrgQ": "Insert the agent parameter. You can also add by typing '/' in the editor.",
"Nh91qA": "Returns the value of the specified variable.",
"NhJPUn": "How can I call an external endpoint?",
Expand Down Expand Up @@ -1627,6 +1634,7 @@
"TxdbTq": "Select a logic app",
"TyFREt": "New Variable",
"TyXFz0": "Logic App Standard",
"TyZznE": "Existing connection",
"Tzq5ot": "Search for an action",
"U086AA": "Target schema element",
"U0I10w": "(UTC+05:00) Ekaterinburg",
Expand Down Expand Up @@ -2372,6 +2380,7 @@
"_5qzZMo.comment": "A message shown at the bottom of a list when the next set of data is loading",
"_5rljf7.comment": "Discovery Panel",
"_5rqV2M.comment": "Indicates that the run has failed",
"_5sZLU4.comment": "Apply the connection expression",
"_5szzYP.comment": "Button text to create workflow from this template",
"_5td/Ux.comment": "Label for description of custom mergeObjects Function",
"_5wYM6C.comment": "Evaluation trigger category description",
Expand Down Expand Up @@ -2473,6 +2482,7 @@
"_7ZR1xr.comment": "Text on example action node",
"_7aJqIH.comment": "Optional locale parameter to apply formatNumber function with",
"_7adnmH.comment": "Button to navigate back to the template library",
"_7bEIoW.comment": "Imported expression is preserved when expression authoring is disabled",
"_7bhWPe.comment": "Function folder name exists in workspace text",
"_7cPLnJ.comment": "Stop chat message",
"_7fI0ys.comment": "Button text for refreshing the knowledge hubs list when refresh is in progress",
Expand Down Expand Up @@ -2637,6 +2647,7 @@
"_Aid5oX.comment": "Label text for the input field to enter a description of the handoff",
"_Ak2Lka.comment": "Chatbot text stating connection to api not made",
"_AkKqDo.comment": "Header label for the built-in tools section in agent loop settings",
"_Aks6v3.comment": "Accessible label for choosing the connection mode",
"_AlPxuK.comment": "This is for a label for a badge, it is used for screen readers and not shown on the screen.",
"_AlWFOS.comment": "Collapse button title",
"_Alq4/3.comment": "Resource group title",
Expand Down Expand Up @@ -2768,6 +2779,7 @@
"_DGMwU4.comment": "Button Label for allowing users to generate from schema",
"_DGPz3M.comment": "Copied button text",
"_DHI56r.comment": "Rules Engine location path label",
"_DI8VPY.comment": "Heading for actions whose connections are selected by expressions",
"_DIDL6K.comment": "Subtitle for the MCP server creation panel",
"_DIH5g2.comment": "Description displayed above the knowledge hubs list",
"_DIwFTo.comment": "Save map info",
Expand Down Expand Up @@ -2855,6 +2867,7 @@
"_F3IDl8.comment": "Required integer parameter to add to time",
"_F3q0Hk.comment": "Message shown when paste is disabled below agents in A2A workflows",
"_F67pEe.comment": "Waiting status",
"_F6vqih.comment": "Label for the runtime connection expression editor",
"_F83QRP.comment": "Schedule trigger category",
"_F9dR1Q.comment": "Add",
"_F9yRDC.comment": "Label for the authentication method",
Expand Down Expand Up @@ -3122,6 +3135,7 @@
"_Kv+Pa3.comment": "Label text for testing publish state",
"_KwGA+K.comment": "Select a Function App resource",
"_KwYMAL.comment": "Refresh button title",
"_Kx/APX.comment": "Error applying the connection expression",
"_L+PY+j.comment": "Required number parameter to get number of objects for take function",
"_L0UAzs.comment": "Label for description of custom dayOfWeek Function",
"_L2xC0I.comment": "Description displayed when there are no connections and hubs in the logic apps.",
Expand Down Expand Up @@ -3257,6 +3271,7 @@
"_NWxGWN.comment": "Placeholder text for new property name",
"_NaW0ga.comment": "Description for state type choice group.",
"_Nbl3zN.comment": "Placeholder for output description field",
"_Ndfl+w.comment": "Validation error for a runtime connection expression",
"_NfFrgQ.comment": "Button label for opening the agent parameter token picker",
"_Nh91qA.comment": "Label for the description of the custom 'variables' function",
"_NhJPUn.comment": "Chatbot suggestion message to call an external endpoint",
Expand Down Expand Up @@ -3592,6 +3607,7 @@
"_TxdbTq.comment": "Placeholder text for logic app selection",
"_TyFREt.comment": "Heading Title for a Variable Without Name",
"_TyXFz0.comment": "Subtitle for the panel to create a logic app resource",
"_TyZznE.comment": "Use a concrete existing connection",
"_Tzq5ot.comment": "Placeholder text for Action search bar",
"_U086AA.comment": "Label for target schema node",
"_U0I10w.comment": "Time zone value ",
Expand Down Expand Up @@ -4049,6 +4065,7 @@
"_cQ/Ocu.comment": "Filter by AI Agent category of connectors",
"_cR0MlP.comment": "Browse folder button",
"_cR9RtV.comment": "Title for discard modal",
"_cTRaCf.comment": "Choose a connection at runtime using an expression",
"_cWFJLe.comment": "Subtitle for skills section",
"_cWpWiU.comment": "Diagnostics information for error message. Don't remove the double single quotes around the placeholder text, which is needed to wrap the placeholder text in single quotes.",
"_cWrYnn.comment": "Workspace folder path label",
Expand Down Expand Up @@ -4172,6 +4189,7 @@
"_ekM77J.comment": "Label for workflow Name",
"_ekrQN7.comment": "Label indicating that the action configuration is complete",
"_elD6+N.comment": "Command for italic text for Mac users",
"_elDTa6.comment": "Status for a connection selected at runtime by an expression",
"_emnH/J.comment": "Prerequisites label",
"_en/5A3.comment": "Button text to reassign actions",
"_ensbBh.comment": "Button text to retry loading connector metadata",
Expand Down Expand Up @@ -4204,6 +4222,7 @@
"_fLchIJ.comment": "Title for the error message shown when creation of logic app fails",
"_fNE/hg.comment": "Text for if image does not show up",
"_fNlJSh.comment": "Error message to show when all connections are not connected",
"_fPjwey.comment": "No design-time connection selected",
"_fQh72N.comment": "Error shown when the feature connector field is missing",
"_fRWxou.comment": "Description for API key connection parameter",
"_fRrZKS.comment": "Light mode image label",
Expand Down Expand Up @@ -4639,6 +4658,7 @@
"_nSan4V.comment": "Reset",
"_nTA155.comment": "Required string parameter to identify which property to remove",
"_nUCvFK.comment": "Number of selected runs",
"_nUmNgD.comment": "Optional concrete connection used only by the designer",
"_nV2Spt.comment": "label for operation details panel component",
"_nVDG00.comment": "Time zone value ",
"_nVhDGu.comment": "Workflow name field placeholder",
Expand Down Expand Up @@ -5115,10 +5135,12 @@
"_w/tTbg.comment": "Text displayed while loading knowledge hubs",
"_w0pNyJ.comment": "Label text for agent key",
"_w16qh+.comment": "Display name for queries in outputs",
"_w19Ytu.comment": "Clarifies that the design-time connection is not a runtime fallback",
"_w1QL1r.comment": "Button text for deleting the hub artifacts",
"_w2VjJS.comment": "Aria label for closing the MCP server creation panel",
"_w2rxzD.comment": "Text to explain that there are no executed tools in the agent iteration",
"_w3BZ0u.comment": "Placeholder text for connector search input",
"_w5FZqt.comment": "Explains runtime connection expression behavior",
"_w5Hhig.comment": "Day of the week",
"_w63mKE.comment": "Label for sources section",
"_w6LBmz.comment": "Azure API Management Service label",
Expand Down Expand Up @@ -5428,6 +5450,7 @@
"cQ/Ocu": "AI Agent",
"cR0MlP": "Browse...",
"cR9RtV": "Discard changes",
"cTRaCf": "Use expression",
"cWFJLe": "Repository skills that provide context for agent execution.",
"cWpWiU": "More diagnostic information: x-ms-client-request-id is ''{clientRequestId}''.",
"cWrYnn": "Workspace folder",
Expand Down Expand Up @@ -5551,6 +5574,7 @@
"ekM77J": "Workflow name",
"ekrQN7": "Configured",
"elD6+N": "Italic (⌘I)",
"elDTa6": "Connection selected at runtime",
"emnH/J": "Prerequisites",
"en/5A3": "Reassign",
"ensbBh": "Retry",
Expand Down Expand Up @@ -5583,6 +5607,7 @@
"fLchIJ": "Creation failed",
"fNE/hg": "Button to add dynamic content if token picker is hidden",
"fNlJSh": "All connections must be connected for workflow creation",
"fPjwey": "None",
"fQh72N": "At least one featured connector is required for publish.",
"fRWxou": "Key will be filled automatically.",
"fRrZKS": "Light-mode SAS URL",
Expand Down Expand Up @@ -6018,6 +6043,7 @@
"nSan4V": "Reset",
"nTA155": "Required. The name of the property to remove.",
"nUCvFK": "{count} selected",
"nUmNgD": "Design-time connection (optional)",
"nV2Spt": "Operation details panel",
"nVDG00": "(UTC+14:00) Kiritimati Island",
"nVhDGu": "Enter workflow name",
Expand Down Expand Up @@ -6494,10 +6520,12 @@
"w/tTbg": "Loading...",
"w0pNyJ": "Agent Key:",
"w16qh+": "Queries",
"w19Ytu": "Used only to browse resources and schemas while editing. This is never a runtime fallback and is not saved with the workflow. Without a selection, enter values manually. Schemas can differ between runtime connections.",
"w1QL1r": "Delete",
"w2VjJS": "Close MCP server creation panel",
"w2rxzD": "This iteration has completed without any tool execution",
"w3BZ0u": "Search...",
"w5FZqt": "The expression selects a connection at runtime. No connection is created by the designer.",
"w5Hhig": "Sunday",
"w63mKE": "Sources",
"w6LBmz": "Azure API Management Service",
Expand Down
31 changes: 31 additions & 0 deletions apps/docs/docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,37 @@ interface DesignerProps {
}
```

### Runtime Connection Selection (Designer V2, Standard)

Designer V2 supports expressions in a Standard `ServiceProvider` action's
`inputs.serviceProviderConfiguration.connectionName`. The
**Change connection > Use expression** editor is enabled by default for supported
actions; no host option is required. Managed API connections, Consumption
workflows, and triggers do not expose expression authoring. Imported expressions
are preserved when their context does not support authoring. Designer V1 is
unchanged and does not offer this editor.

Expression editing is per action, not bulk connection reassignment. The token
picker does not insert implicit loops. For per-item selection within an existing
loop, enter an explicit expression such as `@items('For_each')?['connectionName']`.

An expression such as `@parameters('connectionName')` must resolve at runtime to
an existing, case-sensitive key in `connections.json`, for the action's service
provider. Display names are not connection keys. The Designer does not create
connections at runtime or change their credentials.

The optional **Design-time connection** supplies resource browsing and schema
discovery while editing. This selection is session-only and is not serialized as
a runtime fallback. Without a design-time connection, enter parameter values
manually; connection-dependent browsing is unavailable. Existing values are
preserved. A schema discovered using one connection does not guarantee the same
schema for every runtime target.

Hosts must keep connection keys stable and preserve connections that may be
selected dynamically, even if no action references them statically. For
multi-tenant workflows, map authorized tenant context to permitted connection
keys rather than accepting an arbitrary caller-supplied key as authorization.

### Service Configuration

The designer requires several services to be configured:
Expand Down
25 changes: 25 additions & 0 deletions libs/designer-ui/__test__/connection-expression-editor-helper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { ComponentProps } from 'react';
import type { LexicalEditor } from 'lexical';
import { vi } from 'vitest';

export { $createParagraphNode, $createTextNode, $getRoot } from 'lexical';

// Keep this helper in designer-ui so pnpm resolves the same Lexical dependency
// and conditional ESM entry points as the real editor, but outside src so its
// test-only mocks are not instrumented as production code.
const connectionExpressionEditor = vi.hoisted(() => ({
current: undefined as LexicalEditor | undefined,
}));

export { connectionExpressionEditor };

vi.mock('@lexical/react/LexicalOnChangePlugin', async (importOriginal) => {
const actual = await importOriginal<typeof import('@lexical/react/LexicalOnChangePlugin')>();
const { useLexicalComposerContext } = await import('@lexical/react/LexicalComposerContext');
return {
OnChangePlugin: (props: ComponentProps<typeof actual.OnChangePlugin>) => {
[connectionExpressionEditor.current] = useLexicalComposerContext();
return <actual.OnChangePlugin {...props} />;
},
};
});
16 changes: 15 additions & 1 deletion libs/designer-v2/src/lib/common/models/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,21 @@ export type ReferenceKey = string;
export type ConnectionReferences = Record<ReferenceKey, ConnectionReference>;

export type NodeId = string;
export type ConnectionMapping = Record<NodeId, ReferenceKey | null>;
export interface ExpressionConnectionMapping {
kind: 'expression';
expression: string;
designTimeReferenceKey?: ReferenceKey;
}

export type ConnectionMapping = Record<NodeId, ReferenceKey | null | ExpressionConnectionMapping>;

export const isExpressionConnectionMapping = (mapping: unknown): mapping is ExpressionConnectionMapping =>
typeof mapping === 'object' &&
mapping !== null &&
'kind' in mapping &&
mapping.kind === 'expression' &&
'expression' in mapping &&
typeof mapping.expression === 'string';

export interface WorkflowParameter {
name?: string;
Expand Down
Loading
Loading