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
org_idstringThe organization ID that scopes the operation
user_idstringThe caller's user ID; recorded as created_by_user_id and used for record history
schemastringThe name of the schema (database) that contains the table; defaults to "aweehub"
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. project_id, app_id); values here win over auto-stamped defaults

Outputs

NameTypeDescription
idstring
recordRecord
keystring

Example

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

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

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