Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Uipath maestro flow/Return
Reference · Uipath maestro flow

Return

Part of Uipath maestro flow. Install the skill and your agent reads this page when it needs the depth.

Return / End

Return ends the current path and binds the Flow's declared outputs.

Signature: .return({ outputName: expression, ... }).

.branch('valid', out('check'),
  (yes) => yes.return({ status: 'accepted' }),
  (no) => no.return({ status: 'rejected' }))

Returning in each arm is appropriate when those paths are complete. Let arms fall through to a shared successor when they need common work before the final answer. This is different from .terminate(...): Return completes its path with values; Terminate aborts the whole run.

Any dangling tail gets an End automatically, unless the flow calls .openTails() (decompile writes it; see brownfield.md). An explicit .return(...) is required only when values must be bound. Multiple path ends are emitted as end, end2, end3, and so on.

Only an End sets a flow output. When a step sets an output with { updates }, code reads it as $vars.<output>, or a { shared } input or a default feeds it, the SDK holds the value in a Variable named <output>Value, and every End maps the output from it. You still write the output's own name:

.output({ summary: types.string })
.step('work', script({ code: 'return "hi";', returns: 'string' }), { updates: { summary: out('work') } })
// emits: summaryValue (inout) = $vars.work.output; each End: summary <- $vars.summaryValue

Ending another path at the same End

Give the End a name, and another path can end there with .stepToRef(name) instead of getting an End of its own. The flow then has ONE End with several incoming edges, as the canvas draws it. Needs @uipath/maestro-builder-sdk 6.32.0 or later; an older SDK refuses the ref with REF_UNKNOWN_TARGET,

<!--skill-flavor:named-end-sdk-upgrade:start-->

so upgrade with npm install -g @uipath/maestro-builder-sdk@latest.

<!--skill-flavor:named-end-sdk-upgrade:end-->
.step('fetch', http({ url, managed: true }))
.onError((h) => h.step('reportFailure', script({ code })).stepToRef('done'))
.step('useResult', script({ code }))
.return({}, { name: 'done' })   // reportFailure -> done, useResult -> done

At a glance

End the current path and bind declared Flow outputs.

Choose between arm-local returns and a shared continuation based on the graph the scenario needs.

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.