Skip to content

Invoke Playbook

Type: invoke-playbook  ·  Package: Core Activities v1.0.0

Runs another playbook of the same project, optionally passing input data to it and receiving its results back. It’s the tool to break a large automation into small pieces and reuse logic: instead of copying and pasting the same group of activities in multiple places, you put it in a sub-playbook and invoke it.

  1. Runs the playbook indicated in path, passing it the values of input.
  2. The sub-playbook runs from start to finish with its own variable space (it does not see or modify those of the playbook that called it).
  3. Upon completion, its outputs are mapped to variables of the current playbook according to outputs.
  4. If the sub-playbook fails, the invocation fails (catchable with Try / Catch).
ParameterEditorDescription
pathselector de playbookThe child playbook to run. relative path within the project.
ParameterEditorDescription
inputticketsValues that the sub-playbook receives, as nombre: valor pairs.
outputssalidasMapping the child’s outputs to variables of the current playbook.

For each invoice, invoke a sub-playbook that processes it and returns a status:

For Each items = = facturas itemVariable = factura
└─ activities:
Invoke Playbook
path = "procesar-factura.json"
input = = { factura: factura, reintentos: 3 }
outputs = = { estado: estadoProcesamiento }
Log level = info message = = "Factura procesada: " + estadoProcesamiento
  • input: The child receives factura and reintentos as input variables.
  • outputs: The estado output of the child is saved in the estadoProcesamiento variable of the parent.