Get started

Reference Workflows 06 / 06

Upload file step

Attach a stored file to a file input or file chooser. A step a recorded Writ workflow can run, with its fields and an example.

Runs on Writ CloudWrit Desktop

Open in Claude Open in ChatGPT

The upload step attaches a file to the page — either by setting it on an <input type="file"> directly, or by clicking a trigger and intercepting the file chooser. The file itself is a stored asset, never bytes baked into the recipe.

In a workflow, this step is a JSON object with "type": "upload". Steps run in order, and each step can read the outputs of the steps before it.

Fields

Set these inside the step’s config object.

selector selector required
The file input, or the trigger that opens the chooser.
file_id string
Stored-file handle ("file_…") bound to this step (owner runs).
file_slot string
Named file slot for shared workflows; each user binds the slot to their own file.
mode string
"input" (set on the input element) or "chooser" (click the trigger, intercept the chooser).
is_multiple boolean
Whether the target input accepts multiple files.

Example

One upload step, as it appears in the steps list of a workflow.

Step
{
  "type": "upload",
  "config": { "selector": "input[type='file']", "file_slot": "invoice", "mode": "input" }
}

How it behaves

  • Shared workflows carry a file slot, not a file: each user binds their own stored file to the slot.
  • A file captured earlier by wait_for_download can be reused here via its {{file:slot}} reference.

Where it runs

The step runs wherever its workflow runs. On Writ Desktop, runs are free and can reach systems that only your own network can reach.

On Writ Cloud, each call costs credits: 20 when the run needs a browser, 2 when it does not. A call that fails because of the site or Writ costs nothing.

Next