
Export a Workflow to a Portable Zip File
exportWorkflow.RdThis function exports a workflow to a zip file that can be imported into another repository. It preserves workflow structure, step dependencies, file relationships, and includes all necessary files for reconstruction in a different environment.
Arguments
- workflow
Workflow environment object created by
createWorkflowcontaining the steps and their relationships to export.- workflowName
Character. Name for the exported workflow (without extension). This will be used as the zip filename and internal folder name.
- targetFolder
Character. Directory path where the zip file will be created. Defaults to current directory (".").
Details
The export process includes the following steps:
Creates a workflow template from the provided workflow
Creates a temporary export directory structure
Generates workflow.json with complete step definitions
Exports internal links between steps to internalLinks.json
Downloads and includes external link files
Clones each step's input and output files
Creates mapping templates for links and tools
Packages everything into a single zip file
Export Structure
The exported zip file contains:
workflow.json- Complete workflow metadata and step definitionsinternalLinks.json- Dependencies between workflow stepslinks/- Directory containing external file dependenciesStep folders (named by handle) containing:
inputFiles/- Input files for the stepoutputFiles/- Output files from the step execution
Generated Mapping Templates
The function also creates template mapping files alongside the zip:
[
{
"key": "file-identifier",
"ident": "", # Fill in target repository resource ID
"name": "original-filename",
"hash": "file-hash-for-validation"
}
]
[
{
"key": "server:::tool:::instance:::gridTool",
"runserverLabel": "", # Fill in target server
"toolLabel": "", # Fill in target tool
"toolInstance": "", # Fill in target instance
"gridTool": true/false
}
]
See also
importWorkflow for importing exported workflows
Examples
if (FALSE) { # \dontrun{
# Create and export a workflow
wf <- createWorkflow()
# ... add steps to workflow ...
# Export to current directory
exportWorkflow(wf, "myWorkflow")
# Creates: myWorkflow.zip, myWorkflowLinkMapping.json, myWorkflowToolMapping.json
# Export to specific directory
exportWorkflow(wf, "analysis_v2", targetFolder = "/exports/workflows")
# The generated mapping files can be edited before import to:
# - Point links to existing resources in target repository
# - Map tools to different compute servers
# - Adapt to different environment configurations
} # }