Home

Subworkflows

A subworkflow is a self-contained workflow that is invoked by a parent workflow, functioning as a modular, reusable component. It encapsulates a sequence of tasks that can be executed as a unit, with its own input parameters, outputs, and lifecycle. Subworkflows promote reuse, standardization, and clearer separation of concerns within complex processes.

A subworkflow is typically designed with a defined interface: inputs or parameters provided by the caller,

Benefits of using subworkflows include reduced duplication, easier maintenance, and improved readability of large pipelines. They

Examples of subworkflows appear in various platforms: reusable workflows in GitHub Actions, which can be invoked

and
outputs
or
results
returned
to
the
parent.
It
may
have
its
own
error
handling,
retries,
timeouts,
and
access
controls.
The
execution
can
be
synchronous
or
asynchronous,
and
some
platforms
support
cancellation
or
independent
scheduling.
Versioning
of
subworkflows
helps
maintain
compatibility
as
either
the
parent
or
the
subworkflow
evolves.
Observability,
including
logging
and
tracing,
is
important
to
diagnose
issues
that
cross
the
boundary
between
parent
and
subworkflow.
support
standardization
of
common
tasks,
enable
centralized
governance,
and
simplify
testing
by
allowing
isolated
validation
of
the
subworkflow
logic.
However,
they
introduce
challenges
such
as
increased
complexity
in
debugging
across
workflow
boundaries,
potential
for
version
drift,
and
the
need
for
robust
parameter
passing
and
result
interfaces.
Security
and
permission
management
must
be
carefully
designed
to
control
access
to
data
and
resources
from
within
subworkflows.
by
a
main
workflow
with
input
and
output
exchanges;
nested
state
machines
in
AWS
Step
Functions,
which
start
another
state
machine
and
receive
its
results;
and,
in
some
orchestration
tools,
SubDag
or
modular
task
groups
that
encapsulate
recurring
sequences.