Converts Mistral workflows into Orquesta workflows
The script automatically sets up a virtualenv
(if it doesn't exist) that contains all of the necessary depedencies to run.
Simply run the command for the first time and everything will get setup for you:
git clone https://github.com/StackStorm/orquestaconvert.git
cd orquestaconvert
./bin/orquestaconvert.sh --help
orquestaconvert.sh
- convert a single workflow and print to stdoutYou must specify one or more workflow YAML files to convert as the last arguments to the script.
There are also some options you can use:
-e <type>
- Type of expressions (YAQL or Jinja) to use when inserting new expressions (such as task transitions in the when
clause)--force
- Forces the script to convert and print the workflow even if it does not successfully validate against the Orquesta YAML schema.--validate
- Runs just the validation portion of the script, very useful to validate workflows you partially converted with --force
then finished conversion by hand.Convert the nasa_apod_twitter_post.yaml
workflow from Mistral to Orquesta, using Jinja expressions (the default) in task transition conditions.
./bin/orquestaconvert.sh ./tests/fixtures/mistral/nasa_apod_twitter_post.yaml
Convert the workflow, using YAQL expressions for new task transition conditions, and skips Orquesta workflow validation. Note that this may generate a workflow that is neither a valid Mistral nor a valid Orquesta workflow.
./bin/orquestaconvert.sh -e yaql --force ./tests/fixtures/mistral/nasa_apod_twitter_post.yaml
Run Orquesta YAML schema validation on the file. Returns 0 on successful validation, nonzero on unsuccessful validation. Also use the --verbose
option to explitly print the validation results for the file.
./bin/orquestaconvert.sh --validate ./tests/fixtures/orquesta/nasa_apod_twitter_post.yaml
orquestaconvert-pack.sh
- convert all Mistral workflows in a packThis script scans a pack for all action metadata files and attempts to convert all Mistral workflows to Orquesta and/or validates all Orquesta workflows in a pack using the orquestaconvert.sh
script. This script passes all unrecognized arguments to orquestaconvert.sh
, so all actions you can do on one workflow with that script, you can do to the entire pack by using this script.
You must either run this command from the base directory of a pack or you must specify the directory that contains action metadata files with the --actions-dir
option.
Recognized options are:
--list-workflows <type>
- List all workflows of the specified type (must either be action-chain
for ActionChain, mistral-v2
for Mistral, or orquesta
or orchestra
for Orquesta workflows)--actions-dir <dir>
- Specifies the directory to scan and convertAttempts to convert all workflows from Mistral to Orquesta, using Jinja expressions in new task transitions (Jinja is the default).
./bin/orquestaconvert-pack.sh
Lists remaining Mistral workflows.
./bin/orquestaconvert-pack.sh --list-workflows mistral-v2
Converts all Mistral workflows (using YAQL expressions when generating task transition conditions) in mypack/actions
to Orquesta and skips validation. Note that using this option may create workflows that are neither valid as Mistral nor Orquesta workflows.
./bin/orquestaconvert-pack.sh --expressions yaql --force --action-dir mypack/actions
Explicitly rints the validation results for all Orquesta workflows.
./bin/orquestaconvert-pack.sh --validate --verbose
direct
Mistral Workflows into Orquesta Workflows (general structure)input
, output
, tasks
action
, input
, publish
, on-success
, on-error
, and on-complete
are all convertedtask()
, st2kv
, _.xxx
/ $.xxx
, etc in Jinja and YAQL expressionswith-items
and concurrency
attributesretry
attributes, including continue-on
and simple break-on
expressions{% %}
Jinja expressionsretry
specifications with complex Jinja expressions for continue-on
and break-on
--force
flag to forcibly convert those workflows and convert those expressions manuallyreverse
type workflowstask('xxx')
references to non-local tasks, the current task is always assumed.output-on-error
stanzakeep-result
pause-before
safe-rerun
target
timeout
wait-after
wait-before
workflow
Donated to the StackStorm project by Encore Technologies