Skip to main content

How to run a workflow from another Apache Hop workflow

What this shows​

A workflow can call another workflow. That sounds like a detail and is closer to the whole point: it is what lets you write a sequence once and use it everywhere, instead of copying the same four actions into every process that needs them.

Reference documentationThe complete list of Workflow options is documented in the Apache Hop manual, which is the authoritative reference.hop.apache.org →

Sample workflow​

The workflow in the video is workflows/workflow-action-basic.hwf, in the Putki tutorial samples project.

Transcript​

Full transcript

A workflow can call another workflow. That sounds like a detail and is closer to the whole point: it is what lets you write a sequence once and use it everywhere, instead of copying the same four actions into every process that needs them.

Three actions, and the middle one is an entire workflow: the Copy Files tutorial from earlier in this series, called here without a single change to it. The called workflow does not know it was called.

The dialog is almost the same as the Pipeline action's, which is deliberate on Hop's part: one field for what to run and one for where to run it. Naming the file with a variable is what keeps the reference working when the project moves.

Execute for every result row does the same thing here as it does for a pipeline, and it is the usual way a nested workflow earns its place. A parent that collects a list of files and a child that handles one file is a loop, written as two ordinary workflows.

Running the outer workflow runs the inner one inside it.

Look at the path on the left. The indented actions are the called workflow's, running inside the outer one: its own Start, its copy, its own Success. Then control comes back and the outer workflow finishes. The three files it produced are carried back up, which is how a parent workflow gets to act on what a child did.