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
| Flag | Value | Default | Choices | Description |
|---|---|---|---|---|
--owner_node_id | string | Owner node identifier. | ||
--name | string | Human-readable hook name. | ||
--workflow_yaml | string | Workflow YAML payload for hook execution. |
Optional flags
| Flag | Value | Default | Choices | Description |
|---|---|---|---|---|
--scope | string | Hook scope: self|subtree|graph. | ||
--rerun_policy | string | Rerun policy (currently only if_inputs_changed). | ||
--enabled | Set initial enabled state. | |||
--format | FORMAT | json, tsv, csv, table | Output format for command results. | |
--env | PROFILE | Use a configured CLI profile for this invocation. | ||
--out | PATH | Write output to a file path, or use - for stdout. | ||
--open | Open browser-bound URLs when supported. | |||
--no-retry | Disable transient-error retries. | |||
--retry-max | N | Maximum transient-error retry attempts. | ||
--wait | Block on async operations until a terminal state is reached. | |||
--wait-timeout | SECONDS | 600 | Seconds to wait for --wait before timing out. Defaults to 600. | |
--allow-self | Allow mutating the currently active credential. | |||
--timeout | SECONDS | Set the per-request timeout budget in seconds. | ||
--idempotency-key | KEY | Reuse an Idempotency-Key so ambiguous write failures can be retried with the same key. | ||
--force | Force safety-gated operations where supported. | |||
--yes | Skip confirmation prompts for destructive operations. | |||
--debug | Print structured request debugging with secrets masked. | |||
--verbose | Print verbose progress for long-running operations. | |||
-h, --help | Show 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 --enabledCreate 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