Quick Start Tutorial¶
This tutorial shows how to create and run a simple Hermes workflow that copies a directory and then executes Python code.
Step 1: Create the Workflow JSON¶
Create a file called my_workflow.json:
{
"workflow": {
"root": null,
"nodeList": [
"CopyDirectory",
"RunPythonCode"
],
"nodes": {
"CopyDirectory": {
"Execution": {
"input_parameters": {
"Source": "source",
"Target": "target",
"dirs_exist_ok": true
}
},
"type": "general.CopyDirectory"
},
"RunPythonCode": {
"Execution": {
"input_parameters": {
"ModulePath": "tutorial1",
"ClassName": "tutorialPrinter",
"MethodName": "printDirectories",
"Parameters": {
"source": "{CopyDirectory.output.Source}",
"target": "{CopyDirectory.output.Target}"
}
}
},
"type": "general.RunPythonCode"
}
}
}
}
This workflow:
- CopyDirectory — copies
source/totarget/ - RunPythonCode — runs a Python method, receiving the copy outputs as parameters
Note how RunPythonCode references {CopyDirectory.output.Source} — this creates an automatic dependency.
Step 2: Create the Source Directory¶
Step 3: Build and Execute¶
Use the combined build-and-execute command:
Or run the steps separately:
# Expand the workflow with default values
hermes-workflow expand my_workflow.json my_case
# Build the Luigi Python file
hermes-workflow build my_workflow.json my_case
# Execute the workflow
hermes-workflow execute my_case
Step 4: Check Results¶
The target/ directory should now contain a copy of source/, and the Python code output should appear in the console.
Next Steps¶
- Node Reference — explore all available node types
- Examples — see more complex workflow examples
- CLI Reference — learn all command-line options
- Key Concepts — understand the architecture in depth