KeyRoutines
StepFreeflow.return

Finish a routine early and hand back its results

Finish routine ends the whole routine successfully on the spot and hands back the outputs you fill in. It's the way a small helper routine returns an answer to the routine that started it.

How it works

  • Fill in the routine's outputs by name, using values from earlier steps.
  • The routine stops there and counts as succeeded; any output you declared but didn't fill in comes back empty.
  • Cleanup sections, such as the finally part of a Try, still run before it ends.
  • It can't be used inside an At the same time lane, and the editor warns if you name an output the routine doesn't have.

Routines that use it

A reusable lookup

A helper reads a value with Read JSON value and finishes with it, so other routines get it back through Run routine.

Exit as soon as you know

Inside a loop over List files, finish with the matching file name the moment Compare values finds it.

Shared date maker

One routine builds a file-name date with Format date and returns it to every backup routine that calls it.

Settings

SettingWhat it does
OutputsThe routine's outputs by name: { "path": "{{ steps.save.path }}" }.

Good to know

  • Not allowed inside a parallel lane.

Questions

How do I return a value from one routine to another?
Declare outputs on the helper routine and end it with Finish routine. The calling Run routine step receives them as its outputs.
Is Finish routine a failure?
No. It always ends the routine as succeeded; use Stop routine if you want to end with a failure.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.