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
- 01Type-safe Flow graph authoring
- 02Compile graphs to Flow JSON
- 03Decompile Flow JSON to TypeScript
- 04Define inputs, outputs, steps, and control flow
Use cases
- 01Create a new Maestro Flow in TypeScript
- 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-flowAfter installing, type/uipath-maestro-flowin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
examples/AquariumSafetyStop.flow.tsArchiveCardExtract.flow.tsBakeOffEntryForm.flow.tsBeeHiveLedger.flow.tsBeltProgression.flow.tsbindings.jsonBirdCountLookup.flow.tsClubDirectory.flow.tsConcertSoundcheck.flow.tsDoorbellLog.flow.tsFestivalMapScaffold.flow.tsFieldTripQuickForm.flow.tsFossilCatalogEnrich.flow.tsGallerySubmission.flow.tsGreenhouseWatering.flow.tsHarbourRadioLine.flow.tsHerbariumDispatch.flow.tsKilnReview.flow.tsLibraryDeskChat.flow.tsLighthouseSignal.flow.tsMeteorShowerPages.flow.tsNeighborhoodWalkPlanner.flow.tsObservatorySeeing.flow.tsOralHistoryDigest.flow.tsPlanetariumConfirmation.flow.tsPlantNameAdvisor.flow.tsPostcardCaption.flow.tsPotteryStudioCallback.flow.tsRecipeScaler.flow.tsSeedPacketReader.flow.tsDetails
From the project READMEUiPath 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.jsonwith{ "flowSdk": { "emitOnly": true } }(the product-runtime eval sets it), orFLOW_SDK_EMIT_ONLY=1. Scaffold first (Project layout), then run the block below. - Packaged-SDK local gates otherwise: source
check,compileto 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..inputand.outputare 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 othertypesmembers (integer,float,double,date,datetime,jsonSchema) come from the Case and BPMN builders; the Flow builder andvalidateaccept them without an error, but Workbench does not offer them, so write a date astypes.stringand an integer astypes.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.parallelarm 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, andranis 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 have | look in | a row gives you |
|---|---|---|
a field or method — outcomePorts, stepToList (the usual case) | dist/api-members.md | the shape that declares it, and the lines that do |
an exported symbol — HitlInputs, hitl, FlowBuilder | dist/api-index.md | its 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 surface | Emitted node type | Builder | Reference | Example |
|---|---|---|---|---|
| Manual trigger | core.trigger.manual | omit .trigger(...) | manual-trigger.md | examples/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 trigger | core.trigger.scheduled | scheduled(...) | scheduled-trigger.md | examples/HerbariumDispatch.flow.ts |
| Connector event trigger; a start by an HTTP call | uipath.connector.trigger.<key>.<event> | onEvent(...) | event-trigger.md, HTTP call | examples/DoorbellLog.flow.ts |
| Connector event wait | uipath.connector.event.<key>.<event> | waitForEvent(...) | event-trigger.md | examples/PlanetariumConfirmation.flow.ts |
| Form trigger | core.trigger.form | formTrigger(...) | form-trigger.md | examples/BakeOffEntryForm.flow.ts |
| Conversation trigger | core.trigger.conversation | conversationTrigger(...) | conversational.md | examples/LibraryDeskChat.flow.ts |
| Voice trigger | core.trigger.voice | voiceTrigger(...) | voice.md | examples/HarbourRadioLine.flow.ts |
| Standalone HTTP | core.action.http | http({ managed: false, ... }) | http.md | examples/LighthouseSignal.flow.ts |
| Managed HTTP | core.action.http.v2 | http({ managed: true, ... }) | http.md | examples/ObservatorySeeing.flow.ts |
| Script | core.action.script | script(...) | script.md | examples/GreenhouseWatering.flow.ts |
| Transform | core.action.transform | transform(...) | transform.md | examples/TrailLogSummary.flow.ts |
| Filter | core.action.transform.filter | transform({ variant: 'filter', ... }) | transform.md | examples/TrailLogSummary.flow.ts |
| Map | core.action.transform.map | transform({ variant: 'map', ... }) | transform.md | examples/TrailLogSummary.flow.ts |
| Group by | core.action.transform.group-by | transform({ variant: 'group-by', ... }) | transform.md | examples/TrailLogSummary.flow.ts |
| Integration Service action | uipath.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.md | examples/ClubDirectory.flow.ts |
| Data Fabric read | core.datafabric.read (resultMode: 'multiple' selects its 1.4 definition; limit caps at 1000) | dataFabricRead(...) | data-fabric.md | examples/BeeHiveLedger.flow.ts |
| Data Fabric create | core.datafabric.create | dataFabricCreate(...) | data-fabric.md | examples/BeeHiveLedger.flow.ts |
| Data Fabric update | core.datafabric.update | dataFabricUpdate(...) | data-fabric.md | examples/BeeHiveLedger.flow.ts |
| Data Fabric delete | core.datafabric.delete (declares NO outputs) | dataFabricDelete(...) | data-fabric.md | examples/BeeHiveLedger.flow.ts |
| Subflow | core.subflow | subflow(...) | subflow.md | examples/RecipeScaler.flow.ts |
| Human task | uipath.human-in-the-loop | hitl(...) | hitl.md | examples/GallerySubmission.flow.ts |
| Human quick form | uipath.human-in-the-loop.quick-form (one exit per outcome: .stepSwitch routes them, a plain .step() continues every outcome) | hitl({ variant: 'quick-form', ... }) | hitl.md | examples/FieldTripQuickForm.flow.ts |
| Human action app | uipath.human-in-the-loop.coded-action-app | hitl({ variant: 'action-app', ... }) | hitl.md | examples/KilnReview.flow.ts |
| RPA workflow | uipath.core.rpa-workflow.<key> | rpaWorkflow(...) | rpa-workflow.md | examples/WorkshopInventory.flow.ts |
| Queue item | core.action.queue.create* | queueItem(...) | queue.md | examples/HerbariumDispatch.flow.ts |
| Summarize | uipath.pattern.deep-rag | summarize(...) | summarize.md | examples/OralHistoryDigest.flow.ts |
| Batch transform | uipath.pattern.batch-transform | batchTransform(...) | batch-transform.md | examples/FossilCatalogEnrich.flow.ts |
| Branch | core.logic.decision | .branch(...) | branch.md | examples/GreenhouseWatering.flow.ts |
| Switch | core.logic.switch | .switch(...) | switch.md | examples/BeltProgression.flow.ts |
| Parallel / Merge | core.logic.merge | .parallel(...) | parallel-merge.md | examples/ConcertSoundcheck.flow.ts |
| Loop | core.logic.loop | .loop(...) | loops.md | examples/ClubDirectory.flow.ts |
| Do while | core.logic.dowhile | .doWhile(...) | loops.md | examples/MeteorShowerPages.flow.ts |
| Return / End | core.control.end | .return(...) | return.md | examples/GreenhouseWatering.flow.ts |
| Terminate | core.logic.terminate | .terminate(...) | terminate.md | examples/AquariumSafetyStop.flow.ts |
| Placeholder | core.logic.mock | mock() | placeholder.md | examples/FestivalMapScaffold.flow.ts |
| Unknown node type | the registry's nodeType verbatim (never uipath.connector.*) | rawNode(...) | placeholder.md | — |
| Error handler | error handle on an action node | .onError(...) | error-handling.md | examples/ObservatorySeeing.flow.ts |
| Delay | core.logic.delay | delay(...) | delay.md | examples/LighthouseSignal.flow.ts |
| API workflow | uipath.core.api-workflow.<key> | apiWorkflow(...) | api-workflow.md | examples/BirdCountLookup.flow.ts |
| Agentic process | uipath.core.agentic-process.<key> | agenticProcess(...) | agentic-process.md | examples/NeighborhoodWalkPlanner.flow.ts |
| Agent resource | uipath.core.agent.<key> | agent(...) | agent.md | examples/PlantNameAdvisor.flow.ts |
| External agent or automation | uipath.connector.<key>.<operation> | connector(...), or the CLI when the library lacks it | external-agent.md | — |
| Inline agent | uipath.agent.autonomous | inlineAgent(...) | inline-agent.md | examples/PostcardCaption.flow.ts |
| IxP extraction | uipath.ixp.<project>.<version>-<folder> | ixpExtract(...) | ixp.md | examples/ArchiveCardExtract.flow.ts |
| Document classify | uipath.document.classify | documentClassify(...) | document-pipeline.md | examples/SeedPacketReader.flow.ts |
| Dynamic extract | uipath.ixp.extract-document-builder | dynamicExtract(...) | document-pipeline.md | examples/SeedPacketReader.flow.ts |
| Published function | uipath.core.function.<key> | publishedFunction(...) | published-function.md | examples/TideTableConverter.flow.ts |
| Conversation message wait | uipath.conversational.wait-for-message | waitForMessage(...) | conversational.md | examples/LibraryDeskChat.flow.ts |
| Conversational agent | uipath.agent.conversational | conversationalAgent(...) | conversational.md | examples/LibraryDeskChat.flow.ts |
| Conversation send message | uipath.conversational.send-message | sendMessage(...) | conversational.md | examples/LibraryDeskChat.flow.ts |
| Voice outgoing call | uipath.conversational.voice.create-outgoing-call | createOutgoingCall(...) | voice.md | examples/PotteryStudioCallback.flow.ts |
| Voice agent | uipath.agent.voice | voiceAgent(...) | voice.md | examples/PotteryStudioCallback.flow.ts |
| Voice end call | uipath.conversational.voice.end-call | endCall(...) | voice.md | examples/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.