mcpField
U
uipath-maestro-flow

uipath-maestro-flow

github.com/uipathDevelopment17552 installsUpdated today
Repository

About uipath-maestro-flow

A TypeScript builder skill for developers authoring UiPath Maestro Flows. It turns typed flow graphs into Flow JSON and can decompile existing JSON for editing.

Key features

  1. 01Type-safe Flow graph authoring
  2. 02Compile graphs to Flow JSON
  3. 03Decompile Flow JSON to TypeScript
  4. 04Define inputs, outputs, steps, and control flow

Use cases

  1. 01Create a new Maestro Flow in TypeScript
  2. 02Edit an existing Flow from its JSON artifact

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/uipath/skills --skill uipath-maestro-flow

After installing, type/uipath-maestro-flowin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

examples/
AquariumSafetyStop.flow.ts
ArchiveCardExtract.flow.ts
BakeOffEntryForm.flow.ts
BeeHiveLedger.flow.ts
BeltProgression.flow.ts
bindings.json
BirdCountLookup.flow.ts
ClubDirectory.flow.ts
ConcertSoundcheck.flow.ts
DoorbellLog.flow.ts
FestivalMapScaffold.flow.ts
FieldTripQuickForm.flow.ts
FossilCatalogEnrich.flow.ts
GallerySubmission.flow.ts
GreenhouseWatering.flow.ts
HarbourRadioLine.flow.ts
HerbariumDispatch.flow.ts
KilnReview.flow.ts
LibraryDeskChat.flow.ts
LighthouseSignal.flow.ts
MeteorShowerPages.flow.ts
NeighborhoodWalkPlanner.flow.ts
ObservatorySeeing.flow.ts
OralHistoryDigest.flow.ts
PlanetariumConfirmation.flow.ts
PlantNameAdvisor.flow.ts
PostcardCaption.flow.ts
PotteryStudioCallback.flow.ts
RecipeScaler.flow.ts
SeedPacketReader.flow.ts

Details

From the project README

UiPath Flow — TypeScript Builder SDK

UiPath Flow orchestrations can be authored in TypeScript using the @uipath/maestro-builder-sdk package. The SDK provides a builder API to construct a Flow graph, allowing developers to define inputs, outputs, steps, and control flow in a type-safe manner. The graph is "compiled" down to a Flow JSON, which is the artifact used for executing the Flow on the UiPath platform. An existing Flow JSON can also be decompiled back into TypeScript for editing.

Before writing or editing any flow source, read references/author.md in full. It holds the critical rules this guide only summarizes, the scope gate, and the completion report the final response must follow.

Project layout

@uipath/maestro-builder-sdk is installed globally (npm install -g); examples/ contains authored examples, and references/ contains the details routed from this guide. A Flow is authored as .flow-sdk/<Name>.flow.ts inside its project folder <Solution>/<Name>/, and it imports the package directly.

Authoring files live in .flow-sdk/; the compiled artifact does not. .flow-sdk/ is the SDK's own work directory: the source, bindings.json, connectors/ and connectors-local/ all go there by default, relative to the directory you run uip from. Each Flow project keeps its own, so a solution can hold several flows; Studio Web never reads it, and uip solution pack/upload and flow debug leave it out. Run the SDK verbs (flow check, compile, decompile, merge, registry pull/prepare, node .flow-sdk/*.pipeline.mjs) from the project folder <Solution>/<Name>/, as ( cd "<Solution>/<Name>" && … ) when your shell does not keep its directory between commands; every .flow-sdk/ path in this guide and its references is relative to that folder. Everything else runs from the workspace root. Scaffold the project first, seed the source from it, then emit back into it — compile -o is the authority over where the emitted file is written. <Solution> and <Name> come from the request's own names; one name given for both ("inside a solution of the same name"), or only the Flow's, serves both. <Solution> keeps it as written, spaces included; <Name> keeps only letters, numbers, _ and - (Headcount report form → HeadcountReportForm). Look for an existing solution before uip solution init: run find . -maxdepth 2 -name '*.uipx'. If one exists and a user can answer, ask which to use (one option per solution, then "Create a new solution", then "Something else") and scaffold nothing until they do; never create a second solution silently. Headless, use the solution the request names, else the only one present, else a new one named as above, and record the choice in the final response.

uip solution init "<Solution>"
( cd "<Solution>" && uip maestro flow init <Name> --sdk-source )
# edit <Solution>/<Name>/.flow-sdk/<Name>.flow.ts, then run the Lifecycle loop below

Do not hand-write the skeleton. --sdk-source decompiles the trigger-only artifact flow init writes into the project's .flow-sdk/<Name>.flow.ts, creating the folder; the source carries the flow id and name the product already assigned — a hand-written flow('<name>') invents an id instead. So the stub is the seed rather than litter: the first compile -o overwrites it in place. init refuses an existing source file unless --force; when the source is already there, drop --sdk-source. Maestro Automate is --automate on the same flow init: when the request names Maestro Automate as the product, run ( cd "<Solution>" && uip maestro flow init <Name> --automate --sdk-source ); the bare verb ("automate invoice intake") asks for a plain Flow. Nothing after init changes; the flag writes runtimeOptions.profile into operate.json plus a .maestro_automate marker, and compile -o rewrites only the .flow, so both survive.

An existing project needs no init: skip the first two commands and seed from the .flow that is already there with ( cd "<Solution>/<Name>" && uip maestro flow decompile <Name>.flow -o .flow-sdk/<Name>.flow.ts --no-pipeline ) (--no-pipeline skips the brownfield helper, references/brownfield.md); skip the decompile when the source already exists. The three names stay aligned: .flow-sdk/<Name>.flow.ts, the <Name> project directory, and <Name>.flow inside it. Exactly one emitted <Name>.flow may exist, at <Solution>/<Name>/<Name>.flow, and never a second copy at the workspace root. Emitting to the root is correct only for the packaged-SDK local gates, which never scaffold a project; pick the loop first (Lifecycle) and do not mix the two.

Install the SDK first, once per machine: npm install -g @uipath/maestro-builder-sdk; skip it when already installed, and see references/CLI-LOOP.md for the checks and failure handling.

Integrations with non-UiPath systems are handled through connectors. Choose the node before writing it. For an external service or data (weather, Slack, a REST API), run uip maestro registry search '<brand or service name>' over the local connector library, unless the request names the transport itself ("over HTTP, not a connector" means http()): a hit is a connector, "total": 0 is a miss and means http() (not for an external agent: see the table), and a usage error means the library is not cached, so run uip maestro registry pull first. For document extraction or another tenant capability (agent, process), which that library does not hold, run the family's uip maestro flow registry search (references/ixp.md, references/agent.md). A script() returning fixed values is never a stand-in for that step, and mock() only marks a capability the search proved absent. Connectors require .flow-sdk/bindings.json. uip maestro registry pull writes a descriptor per referenced connector to .flow-sdk/connectors/<key>.ts, and caches the library itself outside the project. Prepared connector modules live at .flow-sdk/connectors-local/<key>.ts; their descriptor data is kept separately below .flow-sdk/connectors-local/descriptors/<key>/. Because the source sits in .flow-sdk/ too, it imports them as ./connectors/<key>.ts and ./connectors-local/<key>.ts.

The connector loop: author → check → prepare → check → compile

Authoring never waits on prepare: once the search above has chosen the node, no further discovery command precedes the source. Write the connector step from the task's own words — the fields you intend, lookup() tokens for ids, { object: '<name-as-the-task-said-it>' } for a generic operation — then run uip maestro flow check .flow-sdk/<Name>.flow.ts --source. Check names every prepare you owe, with the exact command: OBJECT_UNPREPARED for an unmaterialized object, CUSTOM_FIELDS_UNPREPARED for an input outside the tenant-agnostic snapshot, LOOKUP_UNRESOLVED for a lookup token with no recorded value, CONNECTOR_INPUT for a field the operation does not declare. Run that one uip maestro registry prepare <connector-key> --action <action> — --object, --resolve and -f compose in a single invocation, it finds the connection itself, writes .flow-sdk/bindings.json, and repoints your import at the generated ./connectors-local/<key>.ts descriptor — then re-run check and compile. Where two flows import the same connector it names them instead of guessing, and asks for --source. CONNECTOR_NOT_IN_LIBRARY, CONNECTOR_OBJECT_REQUIRED and CONNECTOR_OBJECT_NOT_GENERIC are source fixes, not prepares: connector-params.md.

Schema-dynamic operations (loadByDefault, dependent dropdowns, customFieldsRequestDetails) need the prepare check names with every required -f, and a post-compile cache check: references/connector-params.md.

Hello world Flow
import { flow, script, input, out, types } from '@uipath/maestro-builder-sdk';
export default flow('hello').name('Hello')
  .input({ name: types.string }).output({ greeting: types.string })
  .step('greet', script({ code: 'return `Hello ${$vars.start.output.name}`;' }))
  .return({ greeting: out('greet') }).build();

A script is a first-class Flow node; it runs inline JavaScript and returns a value. The start step is the default name for a "manual trigger", which carries the flow's inputs. A Flow can have outputs, which are returned to the caller when the flow completes successfully.

Lifecycle

Pick one loop before any build command; never mix them in one workspace or use one as a probe for the other:

  • Product-CLI loop (emit-only) when the task asks for product validate/debug evidence, or the workspace is emit-only: a package.json with { "flowSdk": { "emitOnly": true } } (the product-runtime eval sets it), or FLOW_SDK_EMIT_ONLY=1. Scaffold first (Project layout), then run the block below.
  • Packaged-SDK local gates otherwise: source check, compile to the root, validate — references/CLI-LOOP.md.

The uip maestro flow commands delegate their semantics to the installed @uipath/maestro-builder-sdk. Emit-only belongs to the project, not the directory you run from: the nearest package.json up the tree that declares flowSdk.emitOnly decides it, a nested one that does not mention flowSdk inherits, and emitOnly: false opts out. In that mode compile only serializes source, both flow check modes refuse, and product validate owns structural verification. The base pass is emit, any required artifact bindings, then validate:

( cd "<Solution>/<Name>" && uip maestro flow compile .flow-sdk/<Name>.flow.ts -o <Name>.flow )
uip maestro flow validate "<Solution>/<Name>/<Name>.flow" --output json
# Greenfield only (never a merged or .layout() file), before upload/debug/a designer:
uip maestro flow format "<Solution>/<Name>/<Name>.flow" --output json
# Only for a stated runtime-behavior claim:
( cd "<Solution>" && uip solution resources refresh --solution-folder . --output json )
( cd "<Solution>" && uip maestro flow debug <Name> --log-level error \
  --output-filter "{status:finalStatus,instance:instanceId,url:studioWebUrl,failed:elementExecutions[?status!='Completed'].{id:elementId,status:status},<Out>:variables.globals.<Out>,incidents:incidents}" \
  --output json )

<Out>: each declared out variable, never all of variables.globals. Re-run it from compile after the last source or binding edit. Valid is top-level Result plus Data.Status: "Valid"; treat Data.Warnings as failures except the reviewed shared-connection advisory and err() diagnostics. Completed with the expected globals and an empty failed is runtime evidence; a bare exit code is not. Debug inputs, attachments, other projections and incidents: references/CLI-LOOP.md.

Editing an existing flow

In brownfield work, preserve the supplied source, step names, and unaffected wiring. Insert a step by moving the old edge through it, not by creating a second path. If only emitted .flow JSON exists, decompile it, compile the pristine baseline, edit narrowly, and merge the delta back into the original. These are before/after judgments; no final-artifact checker can prove them.

For a narrow edit, decompile writes .flow-sdk/<Name>.pipeline.mjs, which runs the loop in two invocations and gets the baseline ordering right. It keeps its baseline, edited and merged .flow files in .flow-sdk/ too:

uip maestro flow decompile <Name>.flow -o .flow-sdk/<Name>.flow.ts
node .flow-sdk/<Name>.pipeline.mjs      # captures the pristine baseline
# edit .flow-sdk/<Name>.flow.ts narrowly; no .layout() for added steps (builder-sdk#1320)
node .flow-sdk/<Name>.pipeline.mjs      # compiles the edit and merges it back

Back up the project to mktemp -d, cp the merge output over it whole, validate it there (not the edited compile), then delete the backup. Never write or compile onto the canonical .flow. If the source must stay inside the Flow project (for example, to preserve relative sidecars), keep baseline, edited, and candidate .flow files in an external .flow-work/ directory. Install the candidate, validate the canonical artifact, and leave exactly one .flow under the project. The reference below contains the copyable safe-project sequence.

True-brownfield procedure: references/brownfield.md.

Builder frame

The quick start above shows the shape — flow(id), declarations, nodes, .return(...), .build(). Three things it does not show:

  • .var(name, types.*, default?) declares a flow VARIABLE: a value more than one step writes or reads. .input and .output are the flow's contract with its caller; a var is the state in between. A step writes one with { updates: { name: <expr> } }. Inputs, outputs and vars use one of the six types the Flow CLI and Workbench offer: types.string, types.number, types.boolean, types.object, types.array, types.file. The other types members (integer, float, double, date, datetime, jsonSchema) come from the Case and BPMN builders; the Flow builder and validate accept them without an error, but Workbench does not offer them, so write a date as types.string and an integer as types.number. The builder has no node that reads an Orchestrator asset: keep a setting as a var default or an input.

  • .return(...) ends a PATH. .terminate(...) ends the RUN. They look interchangeable on a straight chain and are not: inside a .parallel arm a terminate aborts the sibling arms mid-flight, where a return leaves them going.

  • Expressions are how a step names something that is not a literal. There is one per kind of thing you can refer to:

    refers to
    input(name)a flow input
    v(name)a flow variable
    out(step, path?)a step's result, whole or one field
    err(step, field?)a FAILED step's error envelope — only inside its handler
    ran(step)whether a step ran at all, as a boolean
    lit(value)a constant, where a raw value would be ambiguous
    js`…` / tmpl`…` an expression, or a string, you write yourself

    ran(step) earns an early mention: when arms converge, one shared continuation usually reads better than the same work duplicated per arm, and ran is how that continuation asks whether the value it wants was produced.

API index

Every signature, option shape and field is indexed in the installed @uipath/maestro-builder-sdk package, not in this guide; a row's path is relative to the package root:

you havelook ina row gives you
a field or method — outcomePorts, stepToList (the usual case)dist/api-members.mdthe shape that declares it, and the lines that do
an exported symbol — HitlInputs, hitl, FlowBuilderdist/api-index.mdits kind, area, and the lines that declare it

Match one name; do not read either file end to end. Then read the span (e.g. dist/core/actions.d.ts:583-597): the whole declaration with its doc comment, so one read answers the question. Read the .d.ts, never dist/*.js (no types, no comments). A name in neither index is probably a RUNTIME output key, which the node references carry. Why the index ships in the package, and more lookup rules: references/author.md.

Supported node types

The table is the authoritative router. Before writing a node, read its Reference: the signature, a worked example and the node's hazards live there, not here. Example names the one complete flow to copy from; paths under examples/ resolve inside this skill folder.

Node or surfaceEmitted node typeBuilderReferenceExample
Manual triggercore.trigger.manualomit .trigger(...)manual-trigger.mdexamples/GreenhouseWatering.flow.ts
Entry points (multiple triggers)one trigger node per extra root.entryPoint(id, trigger, { inputs?, version? }, prefixFn?); one var across roots: input { type, shared: '<var>' }manual-trigger.md—
Scheduled triggercore.trigger.scheduledscheduled(...)scheduled-trigger.mdexamples/HerbariumDispatch.flow.ts
Connector event trigger; a start by an HTTP calluipath.connector.trigger.<key>.<event>onEvent(...)event-trigger.md, HTTP callexamples/DoorbellLog.flow.ts
Connector event waituipath.connector.event.<key>.<event>waitForEvent(...)event-trigger.mdexamples/PlanetariumConfirmation.flow.ts
Form triggercore.trigger.formformTrigger(...)form-trigger.mdexamples/BakeOffEntryForm.flow.ts
Conversation triggercore.trigger.conversationconversationTrigger(...)conversational.mdexamples/LibraryDeskChat.flow.ts
Voice triggercore.trigger.voicevoiceTrigger(...)voice.mdexamples/HarbourRadioLine.flow.ts
Standalone HTTPcore.action.httphttp({ managed: false, ... })http.mdexamples/LighthouseSignal.flow.ts
Managed HTTPcore.action.http.v2http({ managed: true, ... })http.mdexamples/ObservatorySeeing.flow.ts
Scriptcore.action.scriptscript(...)script.mdexamples/GreenhouseWatering.flow.ts
Transformcore.action.transformtransform(...)transform.mdexamples/TrailLogSummary.flow.ts
Filtercore.action.transform.filtertransform({ variant: 'filter', ... })transform.mdexamples/TrailLogSummary.flow.ts
Mapcore.action.transform.maptransform({ variant: 'map', ... })transform.mdexamples/TrailLogSummary.flow.ts
Group bycore.action.transform.group-bytransform({ variant: 'group-by', ... })transform.mdexamples/TrailLogSummary.flow.ts
Integration Service actionuipath.connector.<key>.<action> (Data Fabric / Data Service — the ops the native family lacks: file record fields, events: uipath.connector.uipath-uipath-dataservice.*)connector(...)connector-params.mdexamples/ClubDirectory.flow.ts
Data Fabric readcore.datafabric.read (resultMode: 'multiple' selects its 1.4 definition; limit caps at 1000)dataFabricRead(...)data-fabric.mdexamples/BeeHiveLedger.flow.ts
Data Fabric createcore.datafabric.createdataFabricCreate(...)data-fabric.mdexamples/BeeHiveLedger.flow.ts
Data Fabric updatecore.datafabric.updatedataFabricUpdate(...)data-fabric.mdexamples/BeeHiveLedger.flow.ts
Data Fabric deletecore.datafabric.delete (declares NO outputs)dataFabricDelete(...)data-fabric.mdexamples/BeeHiveLedger.flow.ts
Subflowcore.subflowsubflow(...)subflow.mdexamples/RecipeScaler.flow.ts
Human taskuipath.human-in-the-loophitl(...)hitl.mdexamples/GallerySubmission.flow.ts
Human quick formuipath.human-in-the-loop.quick-form (one exit per outcome: .stepSwitch routes them, a plain .step() continues every outcome)hitl({ variant: 'quick-form', ... })hitl.mdexamples/FieldTripQuickForm.flow.ts
Human action appuipath.human-in-the-loop.coded-action-apphitl({ variant: 'action-app', ... })hitl.mdexamples/KilnReview.flow.ts
RPA workflowuipath.core.rpa-workflow.<key>rpaWorkflow(...)rpa-workflow.mdexamples/WorkshopInventory.flow.ts
Queue itemcore.action.queue.create*queueItem(...)queue.mdexamples/HerbariumDispatch.flow.ts
Summarizeuipath.pattern.deep-ragsummarize(...)summarize.mdexamples/OralHistoryDigest.flow.ts
Batch transformuipath.pattern.batch-transformbatchTransform(...)batch-transform.mdexamples/FossilCatalogEnrich.flow.ts
Branchcore.logic.decision.branch(...)branch.mdexamples/GreenhouseWatering.flow.ts
Switchcore.logic.switch.switch(...)switch.mdexamples/BeltProgression.flow.ts
Parallel / Mergecore.logic.merge.parallel(...)parallel-merge.mdexamples/ConcertSoundcheck.flow.ts
Loopcore.logic.loop.loop(...)loops.mdexamples/ClubDirectory.flow.ts
Do whilecore.logic.dowhile.doWhile(...)loops.mdexamples/MeteorShowerPages.flow.ts
Return / Endcore.control.end.return(...)return.mdexamples/GreenhouseWatering.flow.ts
Terminatecore.logic.terminate.terminate(...)terminate.mdexamples/AquariumSafetyStop.flow.ts
Placeholdercore.logic.mockmock()placeholder.mdexamples/FestivalMapScaffold.flow.ts
Unknown node typethe registry's nodeType verbatim (never uipath.connector.*)rawNode(...)placeholder.md—
Error handlererror handle on an action node.onError(...)error-handling.mdexamples/ObservatorySeeing.flow.ts
Delaycore.logic.delaydelay(...)delay.mdexamples/LighthouseSignal.flow.ts
API workflowuipath.core.api-workflow.<key>apiWorkflow(...)api-workflow.mdexamples/BirdCountLookup.flow.ts
Agentic processuipath.core.agentic-process.<key>agenticProcess(...)agentic-process.mdexamples/NeighborhoodWalkPlanner.flow.ts
Agent resourceuipath.core.agent.<key>agent(...)agent.mdexamples/PlantNameAdvisor.flow.ts
External agent or automationuipath.connector.<key>.<operation>connector(...), or the CLI when the library lacks itexternal-agent.md—
Inline agentuipath.agent.autonomousinlineAgent(...)inline-agent.mdexamples/PostcardCaption.flow.ts
IxP extractionuipath.ixp.<project>.<version>-<folder>ixpExtract(...)ixp.mdexamples/ArchiveCardExtract.flow.ts
Document classifyuipath.document.classifydocumentClassify(...)document-pipeline.mdexamples/SeedPacketReader.flow.ts
Dynamic extractuipath.ixp.extract-document-builderdynamicExtract(...)document-pipeline.mdexamples/SeedPacketReader.flow.ts
Published functionuipath.core.function.<key>publishedFunction(...)published-function.mdexamples/TideTableConverter.flow.ts
Conversation message waituipath.conversational.wait-for-messagewaitForMessage(...)conversational.mdexamples/LibraryDeskChat.flow.ts
Conversational agentuipath.agent.conversationalconversationalAgent(...)conversational.mdexamples/LibraryDeskChat.flow.ts
Conversation send messageuipath.conversational.send-messagesendMessage(...)conversational.mdexamples/LibraryDeskChat.flow.ts
Voice outgoing calluipath.conversational.voice.create-outgoing-callcreateOutgoingCall(...)voice.mdexamples/PotteryStudioCallback.flow.ts
Voice agentuipath.agent.voicevoiceAgent(...)voice.mdexamples/PotteryStudioCallback.flow.ts
Voice end calluipath.conversational.voice.end-callendCall(...)voice.mdexamples/PotteryStudioCallback.flow.ts

Authoring a flow

Choose each node from a registry search, never a brand name; ask when the request leaves a finite decision open, including an input value, range, or combination no stated rule covers (never fold it into a stated value; when the request says no one will answer (headless, CI), map it to the most defensible stated value and list it under Open questions as [REQUIRED]); bind every declared output on every path (check misses a missing one, and the run returns undefined); handle an error only when the request says what should happen. The rest is in references/author.md. A request that names a canvas arrangement is .layout() with at()/dim(): references/operate.md.

Operating a deployed flow

Upload, deploy, debug, trigger, inspect a job, and drive an instance's lifecycle. All of it needs uip login, and uip solution resources refresh comes before every upload, publish or debug. flow debug is a REAL run, not a validation step. Read references/operate.md.

Diagnosing a failed run

Triage in order — the debug response you already have, then incidents, runtime variables, the deployed artifact, and traces last. Never re-run flow debug to look again. The builder removes several classic .flow defects and leaves others, including an expression that is really a literal. Read references/diagnose.md.

Evaluating a flow

An inline agent does not create evaluators, eval sets, data points or simulations — the Flow eval CLI manages them as project files. Simulate every side-effecting component before running a set, and never solution upload as part of an eval workflow without asking. Read references/evaluate.md.

Final evidence

The final pass must use the loop appropriate to the packaging mode and run after the last edit. Product-resource truth is live evidence: confirm plausible ids, argument names, scenario-named optional inputs, and warnings against the tenant. Static diagnostics own all mechanically checkable structure; fix their cause rather than copying rules back into this router.

Match proof to the request's acceptance bar. If one wiring question remains, a validate-only bar is complete when product validation is green and its required structural self-check passes; do not add debug only for confidence. For each behavior claim the bar names, plan at most one bounded product debug that answers it. If one wiring question remains, run one bounded experiment that distinguishes it, apply the answer, and stop; do not grow a family of scratch solutions or repeat equivalent variants.

Comments

Markdown supported