Workflows: file handler add
workflows_file_handler_addAdd a FileHandler workflow step to attach, link, or detach a file on a record field with named flags instead of raw params JSON. Set entity, record ID, and field; optionally route success or failure.
Instructions
Add a FileHandler step with named flags (no hand-written params JSON). The step attaches a file to a record's file field: fetch_and_link downloads source_url, link_existing attaches existing_file_id, and detach unlinks it; entity, record_id (usually {{ $anythink.trigger.id }}) and field are always needed. Unlike workflows_step_add it can set on_success/on_failure in the same call, and the step is created disabled unless enabled is set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Step display name (defaults to the step key) | |
| field | No | Field name on the record to link the file to (required, snake_case) | |
| start | No | Set as start step | |
| entity | No | Target entity name (required) | |
| enabled | No | Enable step immediately | |
| step_key | Yes | Step key (unique identifier, snake_case) | |
| file_name | No | Filename to store the uploaded file as (templatable) | |
| folder_id | No | Folder ID to upload the file into (optional, templatable) | |
| is_public | No | Mark the uploaded file as public | |
| link_mode | No | How to link to the field: set (single value) or add (append to multi-value). Default: set | |
| operation | No | FileHandler operation: fetch_and_link, link_existing, detach | |
| record_id | No | Target record ID, typically '{{ $anythink.trigger.id }}' (required) | |
| on_failure | No | Step ID to execute on failure | |
| on_success | No | Step ID to execute on success | |
| source_url | No | URL to fetch the file from (required for fetch_and_link; supports templating) | |
| workflow_id | Yes | Workflow ID. Find it with workflows_list. | |
| existing_file_id | No | Existing file ID (required for link_existing operation; templatable) | |
| overwrite_if_present | No | Re-process even if the field already has a value (idempotency override) |