hooks:create

Create a new hook on an owner node.

Reference for flywheel hooks:create.

Command Group

Hooks Commands

Summary

Create a new hook on an owner node.

Usage

flywheel hooks:create <FLAGS>

Required flags

FlagValueDefaultChoicesDescription
--owner_node_idstringOwner node identifier.
--namestringHuman-readable hook name.
--workflow_yamlstringWorkflow YAML payload for hook execution.

Optional flags

FlagValueDefaultChoicesDescription
--scopestringHook scope: self|subtree|graph.
--rerun_policystringRerun policy (currently only if_inputs_changed).
--enabledSet initial enabled state.
--formatFORMATjson, tsv, csv, tableOutput format for command results.
--envPROFILEUse a configured CLI profile for this invocation.
--outPATHWrite output to a file path, or use - for stdout.
--openOpen browser-bound URLs when supported.
--no-retryDisable transient-error retries.
--retry-maxNMaximum transient-error retry attempts.
--waitBlock on async operations until a terminal state is reached.
--wait-timeoutSECONDS600Seconds to wait for --wait before timing out. Defaults to 600.
--allow-selfAllow mutating the currently active credential.
--timeoutSECONDSSet the per-request timeout budget in seconds.
--idempotency-keyKEYReuse an Idempotency-Key so ambiguous write failures can be retried with the same key.
--forceForce safety-gated operations where supported.
--yesSkip confirmation prompts for destructive operations.
--debugPrint structured request debugging with secrets masked.
--verbosePrint verbose progress for long-running operations.
-h, --helpShow this help.

Examples

Create an enabled subtree hook.

flywheel hooks:create --owner_node_id n_owner --name build --workflow_yaml "on:\n  artifact.finalized: {}\njobs:\n  main:\n    steps:\n      - id: call_eval\n        uses: flywheel/http_request@v1\n        with:\n          url: https://example.invalid/eval\n          method: POST" --scope subtree --enabled

Create an enabled subtree hook that tags finalized submissions.

flywheel hooks:create --owner_node_id n_owner --name tag-red-submissions --workflow_yaml 'on:\n  artifact.finalized: {}\nif:\n  any_artifact:\n    field: metadata.submission_kind\n    eq: red\njobs:\n  main:\n    steps:\n      - id: tag_red_submission\n        uses: flywheel/add_node_tags@v1\n        with:\n          node_id: ${{ event.source_node_id }}\n          tag_ids:\n            - tag-red-submission' --scope subtree --enabled