app:file:save

Inserts a file record, uploads the blob, and stamps the resulting key back onto the record. Errors mid-flight leave the record in place with an empty Field, which is intentional so the row still shows up in audit and list views and operators can inspect the failure

Options

NameTypeDescription
schemastringIs the database selected by the trusted workflow execution context.
tablestringThe name of the table that holds the file record; defaults to "files"
fieldstringIs the FieldTypeFile column on the table that stores the blob key
namestringOf the file (e.g. "payout.xml")
mime_typestringOf the file
kindstringClassifies how the file was produced: "output" (workflow artifact), "input" (user upload consumed by a run), "manual" (user upload, no run)
contentanyOf the file; string or []byte
recordmap[string]anyExtra fields merged onto the inserted file row (e.g. app_id). Values here win over the stamped defaults, except on the identity columns, which the run's principal owns outright

Outputs

NameTypeDescription
idstring
recordRecord
keystring

Example

name: Save a generated report as a file record
actions:
  - name: report
    component: llm:generate
    vars:
      provider: openai
      model: gpt-5
      prompt: "Write a short status report for {{ var.project }}."

  - name: saved
    component: app:file:save
    vars:
      schema: "{{ var.schema }}"
      name: report.md
      mime_type: text/markdown
      content: "{{ report.content }}"

outputs:
  key: "{{ saved.key }}"
  record: "{{ saved.record }}"