-
Notifications
You must be signed in to change notification settings - Fork 0
Module Documentation
Automatic documentation of available modules and functions.
- oa-docker - 3 functions
- oa-git - 6 functions
- oa-io - 7 functions
- oa-json - 7 functions
- oa-moduletemplate - 2 functions
- oa-network - 4 functions
- oa-notify - 3 functions
- oa-pg - 3 functions
- oa-system - 5 functions
- oa-utility - 7 functions
-
container_run()- Starts a Docker container with data propagation -
container_stop()- Stops a Docker container with data propagation -
container_logs()- Retrieves logs from a Docker container
Starts a Docker container with data propagation
Parameters:
-
param (dict) with: -
image: Docker image name - supports {WALLET:key}, {ENV:var} -
name: (optional) container name - supports {ENV:var} -
ports: (optional) dict port mapping e.g. {"8080": "80"} -
volumes: (optional) dict volume mapping -
env: (optional) dict environment variables -
detach: (optional) run in background (default: True) -
remove: (optional) auto-remove on exit (default: False) -
command: (optional) command to execute -
input: (optional) data from previous task -
workflowcontext: (optional) workflow context -
taskid: (optional) unique task id -
taskstore: (optional) TaskResultStore instance
Returns:
tuple (success, outputdict) with container info
Example YAML:
- name: run_nginx
module: oa-docker
function: container_run
image: nginx:latest
name: my_nginx
ports:
"8080": "80"
detach: true
- name: run_app
module: oa-docker
function: container_run
image: myapp:v1
env:
API_KEY: "{WALLET:api_key}"
DB_HOST: "{ENV:DATABASE_HOST}"
volumes:
"/host/data": "/container/data"
Stops a Docker container with data propagation
Parameters:
-
param (dict) with: -
container: container name or ID (can use input from previous task) -
timeout: (optional) timeout in seconds (default: 10) -
input: (optional) data from previous task -
workflowcontext: (optional) workflow context -
taskid: (optional) unique task id -
taskstore: (optional) TaskResultStore instance
Returns:
tuple (success, outputdict) with stopped container info
Example YAML:
- name: stop_nginx
module: oa-docker
function: container_stop
container: my_nginx
timeout: 15
- name: stop_container
module: oa-docker
function: container_stop
Retrieves logs from a Docker container
Parameters:
-
param (dict) with: -
container: container name or ID (can use input from previous task) -
tail: (optional) number of lines (default: all) -
follow: (optional) follow logs in real-time (default: False) -
timestamps: (optional) show timestamps (default: False) -
saveonvar: (optional) save logs to variable -
input: (optional) data from previous task - taskid, taskstore, workflowcontext
Returns:
tuple (success, logs) - propagates the logs
Example YAML:
- name: get_logs
module: oa-docker
function: container_logs
container: my_nginx
tail: 100
timestamps: true
- name: check_logs
module: oa-docker
function: container_logs
saveonvar: container_output
-
clone()- Clones a Git repository with data propagation -
pull()- Executes git pull on an existing repository with data propagation -
push()- Executes git push with data propagation -
tag()- Creates, lists, or deletes Git tags with data propagation -
branch()- Manages Git branches (create, list, delete, checkout) with data propagation -
status()- Gets the Git repository status with data propagation
Clones a Git repository with data propagation
Parameters:
-
param: dict with: -
repo_url: repository URL (https or ssh) - supports {WALLET:key}, {ENV:var} -
dest_path: local destination path -
branch: (optional) specific branch to clone -
depth: (optional) shallow clone with specified depth -
recursive: (optional) recursive submodule clone, default False -
username: (optional) username for HTTPS auth - supports {WALLET:key}, {ENV:var} -
password: (optional) password/token for HTTPS auth - supports {WALLET:key}, {ENV:var} -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with clone info
Example YAML:
- name: clone_public_repo
module: oa-git
function: clone
repo_url: "https://github.com/user/project.git"
dest_path: "/workspace/project"
- name: clone_develop_branch
module: oa-git
function: clone
repo_url: "https://github.com/company/app.git"
dest_path: "/tmp/app"
branch: "develop"
depth: 1
- name: clone_private
module: oa-git
function: clone
repo_url: "https://github.com/company/private.git"
dest_path: "/secure/repo"
username: "{WALLET:git_username}"
password: "{VAULT:git_token}"
- name: clone_with_submodules
module: oa-git
function: clone
repo_url: "{ENV:REPO_URL}"
dest_path: "/workspace/main"
recursive: true
Executes git pull on an existing repository with data propagation
Parameters:
-
param: dict with: -
repo_path: local repository path - supports {ENV:var} -
branch: (optional) branch to pull -
rebase: (optional) use rebase instead of merge, default False -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with pull info
Example YAML:
- name: update_repo
module: oa-git
function: pull
repo_path: "/workspace/myproject"
- name: pull_main_rebase
module: oa-git
function: pull
repo_path: "{ENV:PROJECT_DIR}"
branch: "main"
rebase: true
- name: pull_updates
module: oa-git
function: pull
Executes git push with data propagation
Parameters:
-
param: dict with: -
repo_path: local repository path - supports {ENV:var} -
branch: (optional) branch to push -
remote: (optional) remote name, default 'origin' -
force: (optional) force push, default False -
tags: (optional) push tags, default False -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with push info
Example YAML:
- name: push_changes
module: oa-git
function: push
repo_path: "/workspace/myproject"
branch: "main"
- name: force_push
module: oa-git
function: push
repo_path: "{ENV:REPO_PATH}"
branch: "feature-branch"
force: true
- name: push_with_tags
module: oa-git
function: push
repo_path: "/workspace/app"
tags: true
- name: push_to_backup
module: oa-git
function: push
repo_path: "/workspace/repo"
remote: "backup"
branch: "main"
Creates, lists, or deletes Git tags with data propagation
Parameters:
-
param: dict with: -
repo_path: local repository path - supports {ENV:var} -
operation: 'create'|'list'|'delete' -
tag_name: (optional) tag name (for create/delete) - supports {ENV:var} -
message: (optional) message for annotated tag -
commit: (optional) commit to tag -
push: (optional) push tag after creation, default False -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with tag info
Example YAML:
- name: create_tag
module: oa-git
function: tag
repo_path: "/workspace/project"
operation: create
tag_name: "v1.0.0"
- name: create_release_tag
module: oa-git
function: tag
repo_path: "{ENV:REPO_PATH}"
operation: create
tag_name: "v2.0.0"
message: "Release version 2.0.0"
push: true
- name: list_tags
module: oa-git
function: tag
repo_path: "/workspace/project"
operation: list
- name: delete_tag
module: oa-git
function: tag
repo_path: "/workspace/project"
operation: delete
tag_name: "old-tag"
push: true
Manages Git branches (create, list, delete, checkout) with data propagation
Parameters:
-
param: dict with: -
repo_path: local repository path - supports {ENV:var} -
operation: 'create'|'list'|'delete'|'checkout' -
branch_name: (optional) branch name (for create/delete/checkout) - supports {ENV:var} -
from_branch: (optional) source branch/commit for create -
force: (optional) force delete, default False -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with branch info
Example YAML:
- name: create_feature_branch
module: oa-git
function: branch
repo_path: "/workspace/project"
operation: create
branch_name: "feature/new-feature"
- name: create_from_commit
module: oa-git
function: branch
repo_path: "{ENV:REPO_PATH}"
operation: create
branch_name: "hotfix/bug-123"
from_branch: "main"
- name: list_branches
module: oa-git
function: branch
repo_path: "/workspace/project"
operation: list
- name: switch_to_develop
module: oa-git
function: branch
repo_path: "/workspace/project"
operation: checkout
branch_name: "develop"
- name: delete_old_branch
module: oa-git
function: branch
repo_path: "/workspace/project"
operation: delete
branch_name: "old-feature"
force: true
Gets the Git repository status with data propagation
Parameters:
-
param: dict with: -
repo_path: local repository path - supports {ENV:var} -
short: (optional) short format, default False -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with status info
Example YAML:
- name: check_status
module: oa-git
function: status
repo_path: "/workspace/project"
- name: quick_status
module: oa-git
function: status
repo_path: "{ENV:REPO_PATH}"
short: true
- name: verify_clean
module: oa-git
function: status
-
copy()- Copies files or directories with data propagation -
zip()- Creates a ZIP archive with data propagation -
unzip()- Extracts a ZIP archive with data propagation -
readfile()- Reads file content with data propagation -
writefile()- Writes content to a file with data propagation -
replace()- Replaces text in a variable with data propagation -
loadvarfromjson()- Loads variables from a JSON file into gdict with data propagation
Copies files or directories with data propagation
Parameters:
-
param: dict with: -
srcpath: source path - supports {WALLET:key}, {ENV:var} -
dstpath: destination path - supports {WALLET:key}, {ENV:var} -
recursive: True for directories, False for single file -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with copy information
Example YAML:
- name: backup_config
module: oa-io
function: copy
srcpath: "/etc/app/config.yaml"
dstpath: "/backup/config.yaml"
recursive: false
- name: backup_data_folder
module: oa-io
function: copy
srcpath: "{ENV:DATA_DIR}"
dstpath: "/backup/data"
recursive: true
- name: copy_generated_file
module: oa-io
function: copy
dstpath: "/output/result.txt"
recursive: false
Creates a ZIP archive with data propagation
Parameters:
-
param: dict with: -
zipfilename: ZIP file name - supports {WALLET:key}, {ENV:var} -
pathtozip: path to compress (can use input from previous task) - supports {ENV:var} -
zipfilter: file filter (e.g., ".txt" or "") -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with ZIP info
Example YAML:
- name: create_backup_zip
module: oa-io
function: zip
zipfilename: "/backup/data.zip"
pathtozip:
- "/workspace/project"
zipfilter: "*"
- name: zip_text_files
module: oa-io
function: zip
zipfilename: "{ENV:OUTPUT_DIR}/texts.zip"
pathtozip:
- "/documents"
zipfilter: "*.txt"
- name: zip_copied_files
module: oa-io
function: zip
zipfilename: "/backup/copied.zip"
zipfilter: "*"
- name: zip_multiple_dirs
module: oa-io
function: zip
zipfilename: "/backup/combined.zip"
pathtozip:
-
"/data/folder1"
-
"/data/folder2"
-
"{WALLET:custom_path}"
zipfilter: "*"
Extracts a ZIP archive with data propagation
Parameters:
-
param: dict with: -
zipfilename: ZIP file to extract (can use input from previous task) - supports {ENV:var} -
pathwhereunzip: destination directory - supports {ENV:var} -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with extraction info
Example YAML:
- name: extract_backup
module: oa-io
function: unzip
zipfilename: "/backup/data.zip"
pathwhereunzip: "/restore/data"
- name: extract_download
module: oa-io
function: unzip
zipfilename: "{ENV:DOWNLOAD_DIR}/archive.zip"
pathwhereunzip: "{ENV:EXTRACT_DIR}"
- name: extract_created_zip
module: oa-io
function: unzip
pathwhereunzip: "/tmp/extracted"
Reads file content with data propagation
Parameters:
-
param: dict with: -
filename: file to read (can use input from previous task) - supports {WALLET:key}, {ENV:var} -
varname: (optional) if you only want to return content -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, file_content) - file content is propagated
Example YAML:
- name: read_config
module: oa-io
function: readfile
filename: "/etc/app/config.yaml"
- name: read_log
module: oa-io
function: readfile
filename: "{ENV:LOG_FILE}"
- name: read_generated_file
module: oa-io
function: readfile
- name: read_template
module: oa-io
function: readfile
filename: "/templates/email.html"
varname: email_template
Writes content to a file with data propagation
Parameters:
-
param: dict with: -
filename: file to write - supports {WALLET:key}, {ENV:var} -
varname: (optional if there's input from previous task) -
content: (optional, alternative to varname) - supports {WALLET:key}, {ENV:var} -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with file info
Example YAML:
- name: write_config
module: oa-io
function: writefile
filename: "/tmp/config.txt"
content: "server_url=https://api.example.com"
- name: write_dynamic
module: oa-io
function: writefile
filename: "{ENV:OUTPUT_DIR}/result.txt"
content: "Result: {WALLET:result_value}"
- name: write_processed_data
module: oa-io
function: writefile
filename: "/output/processed.json"
- name: write_from_var
module: oa-io
function: writefile
filename: "/output/data.txt"
varname: my_data_variable
Replaces text in a variable with data propagation
Parameters:
-
param: dict with: -
varname: (optional if there's input) -
leftvalue: text to search for -
rightvalue: replacement text -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, modified_content)
Example YAML:
- name: replace_placeholder
module: oa-io
function: replace
varname: email_template
leftvalue: "{{NAME}}"
rightvalue: "John Doe"
- name: replace_in_content
module: oa-io
function: replace
leftvalue: "localhost"
rightvalue: "production.example.com"
- name: replace_url
module: oa-io
function: replace
leftvalue: "http://"
rightvalue: "https://"
- name: replace_port
module: oa-io
function: replace
leftvalue: ":8080"
rightvalue: ":443"
Loads variables from a JSON file into gdict with data propagation
Parameters:
-
param: dict with: -
filename: JSON file (can use input from previous task) - supports {WALLET:key}, {ENV:var} -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, json_data) - returns parsed JSON data
Example YAML:
- name: load_config
module: oa-io
function: loadvarfromjson
filename: "/etc/app/config.json"
- name: load_settings
module: oa-io
function: loadvarfromjson
filename: "{ENV:CONFIG_DIR}/settings.json"
- name: load_generated_json
module: oa-io
function: loadvarfromjson
-
jsonfilter()- Filters elements in a JSON array based on conditions -
jsonextract()- Extracts specific fields from JSON objects -
jsontransform()- Transforms JSON data by applying mapping and transformations -
jsonmerge()- Merges multiple JSON objects/arrays -
jsonaggregate()- Aggregates JSON data (sum, avg, count, min, max, group) -
jsonvalidate()- Validates JSON against a JSON Schema -
jsonsort()- Sorts JSON array by field
Filters elements in a JSON array based on conditions
Parameters:
-
param (dict) with: -
data: optional JSON data (can use input from previous task) -
field: field to filter on - supports {WALLET:key}, {ENV:var} -
operator: ==, !=, >, <, >=, <=, contains, in, exists, not_exists -
value: comparison value - supports {WALLET:key}, {ENV:var} -
case_sensitive: optional (default: True) -
saveonvar: optional save result to variable -
input: optional data from previous task -
workflowcontext: optional workflow context -
taskid: optional unique task id -
taskstore: optional TaskResultStore instance
Returns:
tuple (success, filtered_data)
Example YAML:
- name: filter_adults
module: oa-json
function: jsonfilter
data:
-
{name: "Alice", age: 30}
-
{name: "Bob", age: 25}
-
{name: "Charlie", age: 35}
field: age
operator: ">"
value: 26
- name: filter_emails
module: oa-json
function: jsonfilter
field: email
operator: contains
value: "@gmail.com"
case_sensitive: false
- name: filter_active_users
module: oa-json
function: jsonfilter
field: status
operator: "=="
value: "active"
- name: filter_has_address
module: oa-json
function: jsonfilter
field: address
operator: exists
value: true
- name: filter_by_category
module: oa-json
function: jsonfilter
field: category
operator: "=="
value: "{WALLET:target_category}"
Extracts specific fields from JSON objects
Parameters:
-
param (dict) with: -
data: optional JSON data (can use input) -
fields: list of fields to extract - supports {WALLET:key}, {ENV:var} -
flatten: optional flatten nested objects (default: False) -
keep_nulls: optional keep null fields (default: False) -
saveonvar: optional save result -
input: optional data from previous task - taskid, taskstore, workflowcontext
Returns:
tuple (success, extracted_data)
Example YAML:
- name: extract_user_info
module: oa-json
function: jsonextract
data:
-
{name: "Alice", age: 30, city: "Rome", country: "Italy"}
-
{name: "Bob", age: 25, city: "Milan", country: "Italy"}
fields:
-
name
-
city
- name: extract_nested
module: oa-json
function: jsonextract
data:
user:
name: "Alice"
email: "alice@example.com"
address:
city: "Rome"
fields:
-
user.name
-
user.address.city
flatten: true
- name: extract_from_api
module: oa-json
function: jsonextract
fields: "id,name,email" # comma-separated string also supported
- name: extract_with_nulls
module: oa-json
function: jsonextract
fields:
-
name
-
optional_field
keep_nulls: true
Transforms JSON data by applying mapping and transformations
Parameters:
-
param (dict) with: -
data: optional JSON data (can use input) -
mapping: dict with {new_field: old_field} or {new_field: "function:old_field"} -
functions: optional dict with custom functions -
add_fields: optional dict with new static fields -
remove_fields: optional list of fields to remove -
saveonvar: optional -
input: optional data from previous task
Returns:
tuple (success, transformed_data)
Example YAML:
- name: rename_user_fields
module: oa-json
function: jsontransform
data:
first_name: "Alice"
last_name: "Smith"
age: 30
mapping:
name: first_name
surname: last_name
years: age
- name: transform_case
module: oa-json
function: jsontransform
mapping:
NAME: "upper:name"
email_lower: "lower:email"
age_int: "int:age"
- name: add_metadata
module: oa-json
function: jsontransform
add_fields:
source: "import"
import_date: "2025-12-30"
version: 1
- name: cleanup_data
module: oa-json
function: jsontransform
remove_fields:
-
internal_id
-
temp_field
-
_metadata
- name: transform_users
module: oa-json
function: jsontransform
data:
- {first_name: "alice", email: "ALICE@EXAMPLE.COM", age: "30"}
mapping:
full_name: "upper:first_name"
email: "lower:email"
age: "int:age"
add_fields:
status: "active"
remove_fields:
- first_name
Merges multiple JSON objects/arrays
Parameters:
-
param (dict) with: -
sources: list of keys from workflowcontext or list of direct data -
merge_type: "dict" (merge objects), "array" (concatenate arrays), "deep" (deep merge) -
overwrite: optional for dict merge (default: True) -
unique: optional remove duplicates in array merge (default: False) -
saveonvar: optional -
input: optional data from previous task (added to merge) -
workflowcontext: optional workflow context
Returns:
tuple (success, merged_data)
Example YAML:
- name: merge_configs
module: oa-json
function: jsonmerge
sources:
-
task_config_base
-
task_config_override
merge_type: dict
overwrite: true
- name: merge_user_lists
module: oa-json
function: jsonmerge
sources:
-
users_from_db
-
users_from_api
merge_type: array
unique: true
- name: deep_merge_settings
module: oa-json
function: jsonmerge
sources:
-
{db: {host: "localhost", port: 5432}}
-
{db: {user: "admin"}, cache: {enabled: true}}
merge_type: deep
- name: merge_with_previous
module: oa-json
function: jsonmerge
sources:
- static_data
merge_type: dict
Aggregates JSON data (sum, avg, count, min, max, group)
Parameters:
-
param (dict) with: -
data: optional JSON array data (can use input) -
operation: sum, avg, count, min, max, group -
field: field to aggregate on - supports {WALLET:key}, {ENV:var} -
group_by: optional field for grouping -
saveonvar: optional -
input: optional data from previous task
Returns:
tuple (success, aggregated_data)
Example YAML:
- name: count_users
module: oa-json
function: jsonaggregate
data:
-
{name: "Alice", age: 30}
-
{name: "Bob", age: 25}
operation: count
- name: total_sales
module: oa-json
function: jsonaggregate
data:
-
{product: "A", amount: 100}
-
{product: "B", amount: 200}
-
{product: "C", amount: 150}
operation: sum
field: amount
- name: avg_age_by_department
module: oa-json
function: jsonaggregate
data:
-
{name: "Alice", age: 30, dept: "IT"}
-
{name: "Bob", age: 25, dept: "IT"}
-
{name: "Charlie", age: 35, dept: "Sales"}
operation: avg
field: age
group_by: dept
- name: group_products
module: oa-json
function: jsonaggregate
operation: group
group_by: category
- name: price_range
module: oa-json
function: jsonaggregate
field: price
operation: min
Validates JSON against a JSON Schema
Parameters:
-
param (dict) with: -
data: optional JSON data (can use input) -
schema: JSON Schema for validation -
strict: optional fail on validation error (default: True) -
saveonvar: optional -
input: optional data from previous task
Returns:
tuple (success, validation_result)
Example YAML:
- name: validate_user
module: oa-json
function: jsonvalidate
data:
name: "Alice"
email: "alice@example.com"
age: 30
schema:
type: object
required:
-
name
-
email
properties:
name:
type: string
email:
type: string
format: email
age:
type: integer
minimum: 0
strict: true
- name: validate_products
module: oa-json
function: jsonvalidate
schema:
type: array
items:
type: object
required:
-
id
-
name
-
price
properties:
id:
type: integer
name:
type: string
price:
type: number
minimum: 0
- name: check_optional_fields
module: oa-json
function: jsonvalidate
schema:
type: object
properties:
optional_field:
type: string
strict: false
Note: Requires jsonschema library: pip install jsonschema
Sorts JSON array by field
Parameters:
-
param (dict) with: -
data: optional JSON array data (can use input) -
sort_by: field for sorting - supports {WALLET:key}, {ENV:var} -
reverse: optional descending order (default: False) -
numeric: optional sort as numbers (default: auto-detect) -
saveonvar: optional -
input: optional data from previous task
Returns:
tuple (success, sorted_data)
Example YAML:
- name: sort_users_by_name
module: oa-json
function: jsonsort
data:
-
{name: "Charlie", age: 35}
-
{name: "Alice", age: 30}
-
{name: "Bob", age: 25}
sort_by: name
- name: sort_by_age_desc
module: oa-json
function: jsonsort
sort_by: age
reverse: true
numeric: true
- name: sort_filtered_results
module: oa-json
function: jsonsort
sort_by: created_date
reverse: true
- name: sort_by_price
module: oa-json
function: jsonsort
sort_by: price
- name: sort_dynamic
module: oa-json
function: jsonsort
sort_by: "{ENV:SORT_FIELD}"
reverse: false
-
templatefunction()- Function description with data propagation -
advanced_function()- Advanced function with support for multiple operations
Function description with data propagation This is a template function showing best practices for: - Data propagation from previous tasks - Parameter validation - Error handling - Output standardization - Logging
Parameters:
-
param: dict with: -
param1: (type) required parameter description -
param2: (type) required parameter description (supports {WALLET:key}, {ENV:var}) -
param3: (type, optional) optional parameter description -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_data) where output_data contains results
Example YAML:
- name: example_task
module: oa-moduletemplate
function: templatefunction
param1: "value1"
param2: "value2"
param3: "optional_value"
- name: secure_task
module: oa-moduletemplate
function: templatefunction
param1: "{WALLET:api_key}"
param2: "{ENV:TARGET_ENV}"
- name: chained_task
module: oa-moduletemplate
function: templatefunction
param2: "additional_value"
- name: safe_task
module: oa-moduletemplate
function: templatefunction
param1: "value1"
param2: "value2"
on_success: next_task
on_failure: error_handler
Advanced function with support for multiple operations This demonstrates how to implement CRUD-style operations with data propagation and proper error handling.
Parameters:
-
param: dict with: -
operation: (str) 'create'|'read'|'update'|'delete' -
target: (str) operation target - supports {WALLET:key}, {ENV:var} -
data: (dict, optional) data for operation -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_data)
Example YAML:
- name: create_resource
module: oa-moduletemplate
function: advanced_function
operation: "create"
target: "user_profile"
data:
name: "John Doe"
email: "john@example.com"
role: "admin"
- name: read_resource
module: oa-moduletemplate
function: advanced_function
operation: "read"
target: "config_settings"
- name: update_resource
module: oa-moduletemplate
function: advanced_function
operation: "update"
target: "user_profile"
- name: delete_resource
module: oa-moduletemplate
function: advanced_function
operation: "delete"
target: "temp_file"
- name: secure_operation
module: oa-moduletemplate
function: advanced_function
operation: "create"
target: "{ENV:TARGET_RESOURCE}"
data:
api_key: "{VAULT:api_secret}"
user: "{WALLET:username}"
- name: multi_step_process
module: oa-moduletemplate
function: advanced_function
operation: "read"
target: "source_data"
- name: process_and_update
module: oa-moduletemplate
function: advanced_function
operation: "update"
data:
processed: true
timestamp: "{WALLET:current_time}"
-
httpget()- Executes an HTTP GET request with data propagation -
httpsget()- Executes an HTTPS GET request with data propagation -
httppost()- Executes an HTTP POST request with data propagation -
httpspost()- Executes an HTTPS POST request with data propagation
Executes an HTTP GET request with data propagation
Parameters:
-
param: dict with: -
host: hostname or IP (can derive from previous input) - supports {WALLET:key}, {ENV:var} -
port: HTTP port - supports {ENV:var} -
get: request path - supports {WALLET:key}, {ENV:var} -
printout: (optional) print response -
saveonvar: (optional) save response to variable -
headers: (optional) dict with custom headers - supports {WALLET:key} in values -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with response data
Example YAML:
- name: fetch_api_data
module: oa-network
function: httpget
host: "api.example.com"
port: 80
get: "/api/v1/users"
- name: api_with_headers
module: oa-network
function: httpget
host: "api.example.com"
port: 80
get: "/api/data"
headers:
User-Agent: "Open-Automator/1.0"
Accept: "application/json"
- name: fetch_from_env
module: oa-network
function: httpget
host: "{ENV:API_HOST}"
port: 80
get: "{ENV:API_PATH}"
printout: true
- name: authenticated_get
module: oa-network
function: httpget
host: "secure-api.example.com"
port: 80
get: "/api/protected"
headers:
Authorization: "Bearer {WALLET:api_token}"
- name: fetch_dynamic_url
module: oa-network
function: httpget
Executes an HTTPS GET request with data propagation
Parameters:
-
param: dict with: -
host: hostname or IP (can derive from previous input) - supports {WALLET:key}, {ENV:var} -
port: HTTPS port - supports {ENV:var} -
get: request path - supports {WALLET:key}, {ENV:var} -
verify: (optional) verify SSL certificate, default True -
printout: (optional) print response -
saveonvar: (optional) save response to variable -
headers: (optional) dict with custom headers - supports {WALLET:key} in values (e.g., tokens) -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with response data
Example YAML:
- name: fetch_secure_api
module: oa-network
function: httpsget
host: "api.example.com"
port: 443
get: "/api/v1/data"
- name: api_with_token
module: oa-network
function: httpsget
host: "api.github.com"
port: 443
get: "/user/repos"
headers:
Authorization: "Bearer {WALLET:github_token}"
Accept: "application/vnd.github.v3+json"
- name: insecure_api_call
module: oa-network
function: httpsget
host: "self-signed.example.com"
port: 443
get: "/api/data"
verify: false
- name: complex_api_call
module: oa-network
function: httpsget
host: "{ENV:API_HOST}"
port: 443
get: "/api/protected/resource"
headers:
Authorization: "Bearer {VAULT:api_secret}"
X-API-Key: "{WALLET:api_key}"
User-Agent: "Open-Automator"
printout: true
- name: fetch_json_data
module: oa-network
function: httpsget
host: "jsonplaceholder.typicode.com"
port: 443
get: "/posts/1"
Executes an HTTP POST request with data propagation
Parameters:
-
param: dict with: -
host: hostname or IP - supports {WALLET:key}, {ENV:var} -
port: HTTP port - supports {ENV:var} -
path: request path - supports {WALLET:key}, {ENV:var} -
data: data to send (can come from previous input) - supports {WALLET:key} -
headers: (optional) dict with custom headers - supports {WALLET:key} in values -
content_type: (optional) default 'application/json' -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with response data
Example YAML:
- name: create_user
module: oa-network
function: httppost
host: "api.example.com"
port: 80
path: "/api/users"
data:
name: "John Doe"
email: "john@example.com"
age: 30
- name: send_credentials
module: oa-network
function: httppost
host: "{ENV:API_HOST}"
port: 80
path: "/api/login"
data:
username: "{WALLET:api_username}"
password: "{VAULT:api_password}"
- name: api_post_with_headers
module: oa-network
function: httppost
host: "api.example.com"
port: 80
path: "/api/data"
headers:
Authorization: "Bearer {WALLET:token}"
X-Custom-Header: "value"
data:
field1: "value1"
field2: "value2"
- name: submit_processed_data
module: oa-network
function: httppost
host: "api.example.com"
port: 80
path: "/api/submit"
- name: post_xml_data
module: oa-network
function: httppost
host: "api.example.com"
port: 80
path: "/api/xml"
content_type: "application/xml"
data: "data"
Executes an HTTPS POST request with data propagation
Parameters:
-
param: dict with: -
host: hostname or IP - supports {WALLET:key}, {ENV:var} -
port: HTTPS port - supports {ENV:var} -
path: request path - supports {WALLET:key}, {ENV:var} -
data: data to send (can come from previous input) - supports {WALLET:key} -
headers: (optional) dict with custom headers - supports {WALLET:key} in values (e.g., API key) -
content_type: (optional) default 'application/json' -
verify: (optional) verify SSL certificate, default True -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with response data
Example YAML:
- name: create_secure_resource
module: oa-network
function: httpspost
host: "api.example.com"
port: 443
path: "/api/v1/resources"
data:
name: "New Resource"
type: "important"
- name: secure_api_post
module: oa-network
function: httpspost
host: "api.github.com"
port: 443
path: "/repos/owner/repo/issues"
headers:
Authorization: "Bearer {VAULT:github_token}"
Accept: "application/vnd.github.v3+json"
data:
title: "Bug report"
body: "Description of the bug"
- name: enterprise_api_call
module: oa-network
function: httpspost
host: "{ENV:ENTERPRISE_API}"
port: 443
path: "/api/submit"
headers:
X-API-Key: "{WALLET:api_key}"
X-Client-ID: "{WALLET:client_id}"
Authorization: "Bearer {VAULT:access_token}"
data:
user_id: "{WALLET:user_id}"
action: "create"
payload:
field1: "value1"
- name: submit_transformed_data
module: oa-network
function: httpspost
host: "api.example.com"
port: 443
path: "/api/bulk"
- name: internal_api_post
module: oa-network
function: httpspost
host: "internal-api.company.local"
port: 443
path: "/api/data"
verify: false
data:
internal_data: "sensitive"
-
sendtelegramnotify()- Sends a Telegram message via bot API with data propagation -
sendmailbygmail()- Sends email via Gmail SMTP SSL with data propagation -
formatmessage()- Formats a message from structured data (helper for notifications)
Sends a Telegram message via bot API with data propagation
Parameters:
-
param: dict with: -
tokenid: Telegram bot token - supports {WALLET:key}, {ENV:var} -
chatid: list of chat_ids - supports {WALLET:key}, {ENV:var} -
message: message to send (can come from previous task input) - supports {WALLET:key}, {ENV:var} -
printresponse: (optional) print response -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with sending info
Example YAML:
- name: notify_success
module: oa-notify
function: sendtelegramnotify
tokenid: "{WALLET:telegram_bot_token}"
chatid:
- "{WALLET:telegram_chat_id}"
message: "Workflow completed successfully!"
- name: send_results
module: oa-notify
function: sendtelegramnotify
tokenid: "{ENV:TELEGRAM_TOKEN}"
chatid:
-
"123456789"
-
"987654321"
- name: alert_team
module: oa-notify
function: sendtelegramnotify
tokenid: "{ENV:BOT_TOKEN}"
chatid: ["{ENV:CHAT_ID}"]
message: "Error occurred: {WALLET:error_message}"
Sends email via Gmail SMTP SSL with data propagation
Parameters:
-
param: dict with: -
senderemail: sender email - supports {WALLET:key}, {ENV:var} -
receiveremail: receiver email - supports {WALLET:key}, {ENV:var} -
senderpassword: sender password - supports {WALLET:key}, {VAULT:key} -
subject: email subject - supports {WALLET:key}, {ENV:var} -
messagetext: (optional) plain text - supports {WALLET:key}, {ENV:var} -
messagehtml: (optional) HTML text - supports {WALLET:key}, {ENV:var} -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with sending info
Example YAML:
- name: send_report
module: oa-notify
function: sendmailbygmail
senderemail: "{ENV:GMAIL_USER}"
receiveremail: "recipient@example.com"
senderpassword: "{VAULT:gmail_app_password}"
subject: "Daily Report"
messagetext: "Here is your daily report..."
- name: send_html_report
module: oa-notify
function: sendmailbygmail
senderemail: "bot@example.com"
receiveremail: "{WALLET:admin_email}"
senderpassword: "{WALLET:email_password}"
subject: "Workflow Results"
messagehtml: "
Workflow completed
"- name: email_results
module: oa-notify
function: sendmailbygmail
senderemail: "{ENV:SENDER}"
receiveremail: "{ENV:RECEIVER}"
senderpassword: "{VAULT:password}"
subject: "Task Output"
Formats a message from structured data (helper for notifications)
Parameters:
-
param: dict with: -
template: (optional) message template with {key} placeholders - supports {WALLET:key}, {ENV:var} -
data: (optional) dict with data to format -
format: (optional) 'json', 'text', 'markdown' -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, formatted_message)
Example YAML:
- name: format_alert
module: oa-notify
function: formatmessage
template: "Status: {status}, Count: {count}, Time: {timestamp}"
data:
status: "success"
count: 42
timestamp: "2025-12-30"
- name: format_json
module: oa-notify
function: formatmessage
format: json
- name: format_markdown
module: oa-notify
function: formatmessage
format: markdown
data:
title: "Report"
items: ["Item 1", "Item 2"]
-
select()- Executes SELECT on PostgreSQL with data propagation -
execute()- Executes INSERT/UPDATE/DELETE on PostgreSQL with data propagation -
insert()- Helper for INSERT with data propagation from previous input
Executes SELECT on PostgreSQL with data propagation
Parameters:
-
param: dict with: -
pgdatabase: database name - supports {WALLET:key}, {ENV:var} -
pgdbhost: host - supports {WALLET:key}, {ENV:var} -
pgdbusername: username - supports {WALLET:key}, {ENV:var} -
pgdbpassword: password - supports {WALLET:key}, {VAULT:key} -
pgdbport: port - supports {ENV:var} -
statement: SQL query (can use input from previous task) - supports {WALLET:key}, {ENV:var} -
printout: (optional) print result, default False -
tojsonfile: (optional) JSON file path -
saveonvar: (optional) save to variable -
format: (optional) 'rows', 'dict', 'json' - default 'dict' -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_data) with query results
Example YAML:
- name: get_users
module: oa-pg
function: select
pgdatabase: "myapp"
pgdbhost: "localhost"
pgdbusername: "postgres"
pgdbpassword: "{VAULT:db_password}"
pgdbport: 5432
statement: "SELECT id, name, email FROM users WHERE active = true"
printout: true
- name: query_production_db
module: oa-pg
function: select
pgdatabase: "{ENV:DB_NAME}"
pgdbhost: "{ENV:DB_HOST}"
pgdbusername: "{WALLET:db_user}"
pgdbpassword: "{VAULT:db_pass}"
pgdbport: 5432
statement: "SELECT * FROM orders WHERE created_at > NOW() - INTERVAL '7 days'"
format: "dict"
- name: export_data
module: oa-pg
function: select
pgdatabase: "analytics"
pgdbhost: "db-server"
pgdbusername: "readonly"
pgdbpassword: "{VAULT:readonly_pass}"
pgdbport: 5432
statement: "SELECT user_id, COUNT(*) as orders FROM orders GROUP BY user_id"
tojsonfile: "/data/user_orders.json"
format: "json"
- name: filtered_query
module: oa-pg
function: select
pgdatabase: "mydb"
pgdbhost: "localhost"
pgdbusername: "app"
pgdbpassword: "{VAULT:app_pass}"
pgdbport: 5432
statement: "SELECT * FROM products WHERE category = '{WALLET:target_category}'"
- name: get_pending_tasks
module: oa-pg
function: select
pgdatabase: "tasks"
pgdbhost: "{ENV:TASK_DB_HOST}"
pgdbusername: "{WALLET:db_user}"
pgdbpassword: "{VAULT:db_pass}"
pgdbport: 5432
statement: "SELECT task_id, description FROM tasks WHERE status = 'pending'"
saveonvar: pending_tasks
format: "dict"
- name: user_orders_report
module: oa-pg
function: select
pgdatabase: "ecommerce"
pgdbhost: "prod-db"
pgdbusername: "{WALLET:reporting_user}"
pgdbpassword: "{VAULT:reporting_pass}"
pgdbport: 5432
statement: |
SELECT u.name, u.email, COUNT(o.id) as order_count, SUM(o.total) as total_spent
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.created_at > '2025-01-01'
GROUP BY u.id, u.name, u.email
ORDER BY total_spent DESC
LIMIT 100
format: "dict"
printout: true
- name: execute_dynamic_query
module: oa-pg
function: select
pgdatabase: "mydb"
pgdbhost: "localhost"
pgdbusername: "user"
pgdbpassword: "{VAULT:pass}"
pgdbport: 5432
Executes INSERT/UPDATE/DELETE on PostgreSQL with data propagation
Parameters:
-
param: dict with: -
pgdatabase: database name - supports {WALLET:key}, {ENV:var} -
pgdbhost: host - supports {WALLET:key}, {ENV:var} -
pgdbusername: username - supports {WALLET:key}, {ENV:var} -
pgdbpassword: password - supports {WALLET:key}, {VAULT:key} -
pgdbport: port - supports {ENV:var} -
statement: SQL statement (can use input from previous task) - supports {WALLET:key}, {ENV:var} -
printout: (optional) print result, default False -
fail_on_zero: (optional) fail if 0 rows affected, default False -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_data) with affected rows count
Example YAML:
- name: activate_user
module: oa-pg
function: execute
pgdatabase: "myapp"
pgdbhost: "localhost"
pgdbusername: "postgres"
pgdbpassword: "{VAULT:db_password}"
pgdbport: 5432
statement: "UPDATE users SET active = true WHERE id = 123"
printout: true
- name: create_order
module: oa-pg
function: execute
pgdatabase: "{ENV:DB_NAME}"
pgdbhost: "{ENV:DB_HOST}"
pgdbusername: "{WALLET:db_user}"
pgdbpassword: "{VAULT:db_pass}"
pgdbport: 5432
statement: |
INSERT INTO orders (user_id, total, status, created_at)
VALUES (456, 99.99, 'pending', NOW())
- name: delete_expired_sessions
module: oa-pg
function: execute
pgdatabase: "sessions"
pgdbhost: "db-server"
pgdbusername: "cleanup"
pgdbpassword: "{VAULT:cleanup_pass}"
pgdbport: 5432
statement: "DELETE FROM sessions WHERE expires_at < NOW()"
fail_on_zero: false
printout: true
- name: update_config
module: oa-pg
function: execute
pgdatabase: "config"
pgdbhost: "localhost"
pgdbusername: "admin"
pgdbpassword: "{VAULT:admin_pass}"
pgdbport: 5432
statement: "UPDATE settings SET value = '{WALLET:new_value}' WHERE key = 'api_endpoint'"
- name: insert_multiple_logs
module: oa-pg
function: execute
pgdatabase: "logs"
pgdbhost: "{ENV:LOG_DB_HOST}"
pgdbusername: "{WALLET:log_user}"
pgdbpassword: "{VAULT:log_pass}"
pgdbport: 5432
statement: |
INSERT INTO access_logs (user_id, action, timestamp)
VALUES
(1, 'login', NOW()),
(2, 'logout', NOW()),
(3, 'view_page', NOW())
- name: bulk_update_prices
module: oa-pg
function: execute
pgdatabase: "ecommerce"
pgdbhost: "prod-db"
pgdbusername: "{WALLET:admin_user}"
pgdbpassword: "{VAULT:admin_pass}"
pgdbport: 5432
statement: |
UPDATE products p
SET price = p.price * 1.1
FROM categories c
WHERE p.category_id = c.id
AND c.name = 'Electronics'
fail_on_zero: true
- name: execute_dynamic_statement
module: oa-pg
function: execute
pgdatabase: "mydb"
pgdbhost: "localhost"
pgdbusername: "user"
pgdbpassword: "{VAULT:pass}"
pgdbport: 5432
- name: archive_old_data
module: oa-pg
function: execute
pgdatabase: "archive"
pgdbhost: "archive-db"
pgdbusername: "{WALLET:archive_user}"
pgdbpassword: "{VAULT:archive_pass}"
pgdbport: 5432
statement: "DELETE FROM old_records WHERE created_at < NOW() - INTERVAL '1 year'"
tojsonfile: "/logs/archive_result.json"
printout: true
Helper for INSERT with data propagation from previous input
Parameters:
-
param: dict with: -
pgdatabase, pgdbhost, pgdbusername, pgdbpassword, pgdbport - support {WALLET: key}, {ENV:var} -
table: table name - supports {WALLET:key}, {ENV:var} -
data: (optional) dict or list of dicts to insert -
input: (optional) data from previous task (if correctly formatted) -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_data)
Example YAML:
- name: insert_user
module: oa-pg
function: insert
pgdatabase: "myapp"
pgdbhost: "localhost"
pgdbusername: "postgres"
pgdbpassword: "{VAULT:db_password}"
pgdbport: 5432
table: "users"
data:
name: "John Doe"
email: "john@example.com"
age: 30
active: true
- name: bulk_insert_products
module: oa-pg
function: insert
pgdatabase: "{ENV:DB_NAME}"
pgdbhost: "{ENV:DB_HOST}"
pgdbusername: "{WALLET:db_user}"
pgdbpassword: "{VAULT:db_pass}"
pgdbport: 5432
table: "products"
data:
- name: "Product A"
price: 19.99
stock: 100
- name: "Product B"
price: 29.99
stock: 50
- name: "Product C"
price: 39.99
stock: 75
- name: insert_api_key
module: oa-pg
function: insert
pgdatabase: "config"
pgdbhost: "localhost"
pgdbusername: "admin"
pgdbpassword: "{VAULT:admin_pass}"
pgdbport: 5432
table: "api_keys"
data:
service_name: "{WALLET:service_name}"
api_key: "{VAULT:api_key}"
created_at: "NOW()"
- name: insert_transformed_data
module: oa-pg
function: insert
pgdatabase: "warehouse"
pgdbhost: "data-db"
pgdbusername: "{WALLET:etl_user}"
pgdbpassword: "{VAULT:etl_pass}"
pgdbport: 5432
table: "staging_data"
- name: insert_filtered_users
module: oa-pg
function: insert
pgdatabase: "reports"
pgdbhost: "reporting-db"
pgdbusername: "{WALLET:report_user}"
pgdbpassword: "{VAULT:report_pass}"
pgdbport: 5432
table: "active_users_report"
Note: Uses parameterized queries for SQL injection protection
-
runcmd()- Executes a local shell command with data propagation -
systemd()- Manages systemd services on remote server with data propagation -
remotecommand()- Executes a remote command via SSH with data propagation -
scp()- Transfers files/directories via SCP with data propagation -
execute_script()- Executes a local script and propagates output
Executes a local shell command with data propagation
Parameters:
-
param: dict with: -
command: command to execute (can use input from previous task) - supports {WALLET:key}, {ENV:var} -
printout: (optional) print output, default False -
saveonvar: (optional) save output to variable -
shell: (optional) use shell, default True -
timeout: (optional) timeout in seconds -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with command output
Example YAML:
- name: list_files
module: oa-system
function: runcmd
command: "ls -la /var/log"
printout: true
- name: backup_database
module: oa-system
function: runcmd
command: "mysqldump -u root -p{ENV:DB_PASSWORD} mydb > /backup/mydb.sql"
- name: long_running_process
module: oa-system
function: runcmd
command: "python3 /scripts/process_data.py"
timeout: 300
printout: true
- name: secure_command
module: oa-system
function: runcmd
command: "curl -H 'Authorization: Bearer {WALLET:api_token}' https://api.example.com/data"
- name: execute_generated_command
module: oa-system
function: runcmd
- name: get_system_info
module: oa-system
function: runcmd
command: "uname -a"
saveonvar: system_info
- name: deploy_service
module: oa-system
function: runcmd
command: "docker run -e API_KEY={VAULT:api_key} -e ENV={ENV:ENVIRONMENT} myapp:latest"
shell: true
timeout: 60
Manages systemd services on remote server with data propagation
Parameters:
-
param: dict with: -
remoteserver: remote host - supports {WALLET:key}, {ENV:var} -
remoteuser: SSH username - supports {WALLET:key}, {ENV:var} -
remotepassword: SSH password - supports {WALLET:key}, {VAULT:key} -
remoteport: SSH port - supports {ENV:var} -
servicename: service name - supports {WALLET:key}, {ENV:var} -
servicestate: start|stop|restart|status|daemon-reload -
saveonvar: (optional) save output to variable -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with systemd output
Example YAML:
- name: start_nginx
module: oa-system
function: systemd
remoteserver: "web-server-01"
remoteuser: "admin"
remotepassword: "{VAULT:ssh_password}"
remoteport: 22
servicename: "nginx"
servicestate: "start"
- name: restart_app
module: oa-system
function: systemd
remoteserver: "{ENV:APP_SERVER}"
remoteuser: "{WALLET:ssh_user}"
remotepassword: "{VAULT:ssh_pass}"
remoteport: 22
servicename: "myapp"
servicestate: "restart"
- name: check_docker_status
module: oa-system
function: systemd
remoteserver: "docker-host"
remoteuser: "root"
remotepassword: "{VAULT:root_password}"
remoteport: 22
servicename: "docker"
servicestate: "status"
saveonvar: docker_status
- name: reload_systemd
module: oa-system
function: systemd
remoteserver: "{ENV:TARGET_SERVER}"
remoteuser: "admin"
remotepassword: "{VAULT:admin_pass}"
remoteport: 22
servicename: ""
servicestate: "daemon-reload"
- name: stop_service
module: oa-system
function: systemd
remoteserver: "app-server"
remoteuser: "{WALLET:deploy_user}"
remotepassword: "{VAULT:deploy_pass}"
remoteport: 22
servicename: "old-service"
servicestate: "stop"
- name: manage_dynamic_service
module: oa-system
function: systemd
remoteserver: "server-01"
remoteuser: "admin"
remotepassword: "{VAULT:ssh_pass}"
remoteport: 22
servicestate: "restart"
Executes a remote command via SSH with data propagation
Parameters:
-
param: dict with: -
remoteserver: remote host - supports {WALLET:key}, {ENV:var} -
remoteuser: SSH username - supports {WALLET:key}, {ENV:var} -
remotepassword: SSH password - supports {WALLET:key}, {VAULT:key} -
remoteport: SSH port - supports {ENV:var} -
command: command to execute (can use input from previous task) - supports {WALLET:key}, {ENV:var} -
saveonvar: (optional) save output to variable -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with remote command output
Example YAML:
- name: check_disk_space
module: oa-system
function: remotecommand
remoteserver: "web-server-01"
remoteuser: "admin"
remotepassword: "{VAULT:ssh_password}"
remoteport: 22
command: "df -h"
- name: deploy_app
module: oa-system
function: remotecommand
remoteserver: "{ENV:PROD_SERVER}"
remoteuser: "{WALLET:deploy_user}"
remotepassword: "{VAULT:deploy_pass}"
remoteport: 22
command: "cd /opt/app && git pull && systemctl restart myapp"
- name: list_containers
module: oa-system
function: remotecommand
remoteserver: "docker-host"
remoteuser: "root"
remotepassword: "{VAULT:root_password}"
remoteport: 22
command: "docker ps -a"
saveonvar: container_list
- name: run_remote_script
module: oa-system
function: remotecommand
remoteserver: "{ENV:APP_SERVER}"
remoteuser: "{WALLET:ssh_user}"
remotepassword: "{VAULT:ssh_pass}"
remoteport: 22
command: "/home/admin/scripts/backup.sh"
- name: remote_deploy
module: oa-system
function: remotecommand
remoteserver: "app-server"
remoteuser: "deployer"
remotepassword: "{VAULT:deployer_pass}"
remoteport: 22
command: "export ENV=production && /opt/deploy.sh"
- name: execute_generated_command
module: oa-system
function: remotecommand
remoteserver: "remote-host"
remoteuser: "admin"
remotepassword: "{VAULT:ssh_pass}"
remoteport: 22
- name: setup_environment
module: oa-system
function: remotecommand
remoteserver: "{ENV:TARGET_HOST}"
remoteuser: "root"
remotepassword: "{VAULT:root_pass}"
remoteport: 22
command: |
cd /opt/app &&
git pull origin main &&
pip install -r requirements.txt &&
systemctl restart myservice
Transfers files/directories via SCP with data propagation
Parameters:
-
param: dict with: -
remoteserver: remote host - supports {WALLET:key}, {ENV:var} -
remoteuser: SSH username - supports {WALLET:key}, {ENV:var} -
remotepassword: SSH password - supports {WALLET:key}, {VAULT:key} -
remoteport: SSH port - supports {ENV:var} -
localpath: local path (can use input from previous task) - supports {WALLET:key}, {ENV:var} -
remotepath: remote path - supports {WALLET:key}, {ENV:var} -
recursive: True/False -
direction: localtoremote|remotetolocal -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with transfer info
Example YAML:
- name: upload_config
module: oa-system
function: scp
remoteserver: "web-server-01"
remoteuser: "admin"
remotepassword: "{VAULT:ssh_password}"
remoteport: 22
localpath: "/local/config.yml"
remotepath: "/etc/myapp/config.yml"
recursive: false
direction: "localtoremote"
- name: download_logs
module: oa-system
function: scp
remoteserver: "{ENV:PROD_SERVER}"
remoteuser: "{WALLET:ssh_user}"
remotepassword: "{VAULT:ssh_pass}"
remoteport: 22
localpath: "/backup/logs"
remotepath: "/var/log/myapp/app.log"
recursive: false
direction: "remotetolocal"
- name: upload_website
module: oa-system
function: scp
remoteserver: "web-server"
remoteuser: "www-data"
remotepassword: "{VAULT:web_pass}"
remoteport: 22
localpath: "/local/website/*"
remotepath: "/var/www/html/"
recursive: true
direction: "localtoremote"
- name: download_backup
module: oa-system
function: scp
remoteserver: "{ENV:BACKUP_SERVER}"
remoteuser: "{WALLET:backup_user}"
remotepassword: "{VAULT:backup_pass}"
remoteport: 22
localpath: "/local/backups/db-backup.sql.gz"
remotepath: "/backups/database/latest.sql.gz"
recursive: false
direction: "remotetolocal"
- name: sync_configs
module: oa-system
function: scp
remoteserver: "app-server"
remoteuser: "deployer"
remotepassword: "{VAULT:deploy_pass}"
remoteport: 22
localpath:
-
"/local/config1.yml"
-
"/local/config2.yml"
-
"/local/config3.yml"
remotepath:
-
"/etc/app/config1.yml"
-
"/etc/app/config2.yml"
-
"/etc/app/config3.yml"
recursive: false
direction: "localtoremote"
- name: upload_generated_file
module: oa-system
function: scp
remoteserver: "server-01"
remoteuser: "admin"
remotepassword: "{VAULT:ssh_pass}"
remoteport: 22
remotepath: "/opt/data/uploaded.txt"
recursive: false
direction: "localtoremote"
- name: backup_directory
module: oa-system
function: scp
remoteserver: "{ENV:BACKUP_HOST}"
remoteuser: "backup"
remotepassword: "{VAULT:backup_password}"
remoteport: 22
localpath: "/backup/$(date +%Y%m%d)"
remotepath: "/var/backups/myapp/"
recursive: true
direction: "remotetolocal"
Executes a local script and propagates output
Parameters:
-
param: dict with: -
script_path: script path (can use input from previous task) - supports {WALLET:key}, {ENV:var} -
args: (optional) list of arguments - supports {WALLET:key}, {ENV:var} -
interpreter: (optional) interpreter (e.g., 'python3', 'bash'), default auto-detect -
timeout: (optional) timeout in seconds -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) unique task id -
task_store: (optional) TaskResultStore instance
Returns:
tuple: (success, output_dict) with script output
Example YAML:
- name: run_data_processor
module: oa-system
function: execute_script
script_path: "/opt/scripts/process_data.py"
interpreter: "python3"
- name: run_backup_script
module: oa-system
function: execute_script
script_path: "/home/admin/backup.sh"
args:
-
"/var/lib/myapp"
-
"/backup/$(date +%Y%m%d)"
interpreter: "bash"
- name: run_perl_script
module: oa-system
function: execute_script
script_path: "/scripts/monitor.pl"
- name: deploy_with_credentials
module: oa-system
function: execute_script
script_path: "/opt/deploy.sh"
args:
-
"{ENV:ENVIRONMENT}"
-
"{WALLET:deploy_key}"
-
"{VAULT:db_password}"
interpreter: "bash"
- name: long_running_script
module: oa-system
function: execute_script
script_path: "/scripts/import_data.py"
interpreter: "python3"
timeout: 600
- name: run_generated_script
module: oa-system
function: execute_script
interpreter: "bash"
- name: run_node_script
module: oa-system
function: execute_script
script_path: "/app/server.js"
args:
-
"--port"
-
"3000"
interpreter: "node"
- name: run_ruby_app
module: oa-system
function: execute_script
script_path: "{ENV:APP_DIR}/app.rb"
args:
- "production"
interpreter: "ruby"
- name: run_executable
module: oa-system
function: execute_script
script_path: "/usr/local/bin/custom_tool"
args:
-
"--config"
-
"/etc/tool.conf"
Note: Supported auto-detect extensions:
-
.py -> python3
-
.sh -> bash
-
.rb -> ruby
-
.js -> node
-
.pl -> perl
-
setsleep()- Pauses execution for a specified number of seconds with data propagation -
printvar()- Prints the value of a variable or input with data propagation -
setvar()- Sets the value of a variable with data propagation -
dumpvar()- Exports all gdict variables to a JSON file with data propagation -
transform()- Transforms data with various operations (upper, lower, strip, etc.) -
condition()- Evaluates a condition for workflow branching -
merge()- Merges data from multiple sources
Pauses execution for a specified number of seconds with data propagation
Parameters:
-
param: dict with: -
seconds: number of seconds to wait - supports {WALLET:key}, {ENV:var} -
input: (optional) data from previous task (passthrough) -
workflow_context: (optional) workflow context -
task_id: (optional) -
task_store: (optional)
Returns:
tuple: (success, input_data) - propagates received input
Example YAML:
- name: wait_5_seconds
module: oa-utility
function: setsleep
seconds: 5
on_success: next_task
- name: wait_dynamic
module: oa-utility
function: setsleep
seconds: "{ENV:DELAY_SECONDS}"
on_success: continue_workflow
Prints the value of a variable or input with data propagation
Parameters:
-
param: dict with: -
varname: (optional) variable name to print - supports {WALLET:key}, {ENV:var} -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) -
task_store: (optional)
Returns:
tuple: (success, printed_value) - propagates the printed value
Example YAML:
- name: print_result
module: oa-utility
function: printvar
varname: my_result
- name: print_previous_output
module: oa-utility
function: printvar
on_success: next_step
Sets the value of a variable with data propagation
Parameters:
-
param: dict with: -
varname: variable name - supports {WALLET:key}, {ENV:var} -
varvalue: value to assign (can use input) - supports {WALLET:key}, {ENV:var} -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) -
task_store: (optional)
Returns:
tuple: (success, set_value) - propagates the set value
Example YAML:
- name: set_counter
module: oa-utility
function: setvar
varname: counter
varvalue: 0
- name: set_api_url
module: oa-utility
function: setvar
varname: api_url
varvalue: "{ENV:API_ENDPOINT}"
- name: save_response
module: oa-utility
function: setvar
varname: api_response
Exports all gdict variables to a JSON file with data propagation
Parameters:
-
param: dict with: -
savetofile: (optional) JSON output file path - supports {WALLET:key}, {ENV:var} -
include_input: (optional) also include input in dump -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) -
task_store: (optional)
Returns:
tuple: (success, variables_dict) - propagates all variables
Example YAML:
- name: export_variables
module: oa-utility
function: dumpvar
savetofile: "/tmp/workflow_vars.json"
- name: export_to_env_path
module: oa-utility
function: dumpvar
savetofile: "{ENV:OUTPUT_DIR}/vars.json"
Transforms data with various operations (upper, lower, strip, etc.)
Parameters:
-
param: dict with: -
operation: transformation type ('upper', 'lower', 'strip', 'replace', 'split', 'join') -
data: (optional) data to transform -
input: (optional) data from previous task -
options: (optional) dict with operation-specific options -
workflow_context: (optional) workflow context -
task_id: (optional) -
task_store: (optional)
Returns:
tuple: (success, transformed_data)
Example YAML:
- name: uppercase_text
module: oa-utility
function: transform
operation: upper
data: "hello world"
- name: clean_output
module: oa-utility
function: transform
operation: strip
- name: split_csv
module: oa-utility
function: transform
operation: split
data: "a,b,c,d"
options:
separator: ","
Evaluates a condition for workflow branching
Parameters:
-
param: dict with: -
left: left operand - supports {WALLET:key}, {ENV:var} -
right: right operand - supports {WALLET:key}, {ENV:var} -
operator: comparison operator ('equals', 'not_equals', 'contains', 'greater', 'less', 'exists', 'is_empty') -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) -
task_store: (optional)
Returns:
tuple: (condition_result, output_dict) - task_success reflects condition result
Example YAML:
- name: check_status
module: oa-utility
function: condition
left: "{WALLET:status}"
operator: equals
right: "success"
on_success: success_handler
on_failure: error_handler
- name: check_var_exists
module: oa-utility
function: condition
left: "{WALLET:result}"
operator: exists
- name: check_count
module: oa-utility
function: condition
left: "{WALLET:count}"
operator: greater
right: 100
Merges data from multiple sources
Parameters:
-
param: dict with: -
merge_type: 'dict'|'list'|'concat' -
sources: list of keys from workflow_context -
separator: (optional) for concat - supports {WALLET:key}, {ENV:var} -
input: (optional) data from previous task -
workflow_context: (optional) workflow context -
task_id: (optional) -
task_store: (optional)
Returns:
tuple: (success, merged_data)
Example YAML:
- name: merge_configs
module: oa-utility
function: merge
merge_type: dict
sources:
-
task1_output
-
task2_output
- name: join_messages
module: oa-utility
function: merge
merge_type: concat
sources:
-
msg1
-
msg2
separator: " | "
- name: combine_arrays
module: oa-utility
function: merge
merge_type: list
sources:
-
list1
-
list2
Documentation automatically generated by generate_readme.py