Plugins batch execution¶
Important
Available since version 1.1.0 of the transpiler-mate-runtime
The batch plugin runs multiple plugin executions sequentially with the same resolved CWL context. An execution plan in YAML specifies the plugins and their inputs.
Describe your pipeline with TMOM¶
The TMOM (Transpiler-Mate Model Object) describes which plugins to run and the options for each execution. Stored by default in tmom.yaml, it brings your artifact-generation steps into one reusable plan that you can version alongside your workflow.
Each top-level key is the name of an installed plugin. Its value is a list of executions, with each list item containing that plugin's options. Add multiple items to run the same plugin with different settings or output destinations. Use option field names such as output, rather than CLI flags such as --output; use {} for an execution that needs only defaults.
Load the CWL once, reuse it across plugins¶
Running plugins as separate CLI commands repeats the source-loading work for each command. With batch execution, the runtime loads and resolves the input CWL and validates its software metadata once, then passes the same in-memory TranspilerContext to every execution in the TMOM.
This avoids repeating source retrieval, CWL parsing, and context preparation just to generate another artifact. It is especially useful for larger workflows or remote sources: documentation, diagrams, explorers, and supply-chain reports can all start from the same resolved workflow.
Plugins still perform their own work, such as inspecting container images or writing output files. A plugin that explicitly loads an additional source—for example, baseline loading a previous release—still needs to resolve that source. Batch reuses the primary context; it does not cache every operation or run plugins in parallel.
Create and run a plan¶
Create tmom.yaml in your working directory:
cwl2sbom:
- platform: 'linux/amd64'
output: 'build/sbom'
cwl2markdown:
- output: 'build/docs'
cwl2puml:
- output: 'build/diagrams'
cwl2webgl:
- output: 'build/explorers'
baseline:
- previous: 'oci://mycompany.org/released.cwl'
output: 'baseline.json'
Then run:
transpiler-mate batch workflow.cwl#main
Install all plugins named in the plan in the same Python environment as the runtime. To select another TMOM file, use:
transpiler-mate batch workflow.cwl#main --file plans/release.yaml
Relative paths, including output locations, are interpreted from the working directory, not from the directory containing the TMOM file.
Execution order and failures¶
Plugins run in the order their keys appear in the YAML, and each plugin's executions run in list order. The batch plugin validates the plan's structure first, then validates each execution's options against the target plugin's model immediately before running it.
Execution stops at the first failure. Earlier artifacts are not rolled back, so check existing outputs before rerunning a partially completed plan. Plugin authors should treat the shared context as read-only to avoid affecting subsequent executions.