Command
Command hooks allow you to execute system commands or scripts as part of your replication workflow. This is particularly useful for running data processing scripts, triggering external processes, or performing system-level operations.
Configuration
Properties
command
Yes
Array containing the command and its arguments
No
Whether to print command output to console (default: false)
capture
No
Whether to capture command output in hook result (default: false)
env
No
Map of environment variables to set for the command
on_failure
No
What to do if the command fails (abort/warn/quiet/skip)
Output
When the command hook executes successfully, it returns the following output that can be accessed in subsequent hooks:
You can access these values in subsequent hooks using the following syntax (jmespath
):
{state.hook_id.status}
- Status of the hook execution{state.hook_id.binary}
- The binary that was executed{state.hook_id.arguments}
- The arguments passed to the command{state.hook_id.start}
- Command start time{state.hook_id.end}
- Command end time{state.hook_id.output.stdout}
- Standard output (if capture: true){state.hook_id.output.stderr}
- Standard error (if capture: true){state.hook_id.output.combined}
- Combined output (if capture: true)
Examples
Run Data Processing Script
Execute a Python script to process data before replication:
System Cleanup
Clean up temporary files after processing:
Run Data Quality Checks
Execute a data quality checking script and capture its output:
Conditional Command Execution
Run commands based on environment or conditions:
Run Shell Script
Execute a shell script with parameters:
Generate Reports
Run a report generation tool after successful replication:
Last updated