Skip to content

civex.create_records_from_files

Create one child record per file in a file list. No key matching — every file becomes a new record. Reach for this over civex.match_files_to_records when you know none of the files correspond to existing records, e.g. ingesting a batch of new recordings.

Because new records fire record_updated on creation, any record_updated workflow triggered on the new schema's file field runs automatically for each created record.

Plugin ID: civex.create_records_from_files
Category: outputs
Capabilities: create_record

Config

Field Type Required Default Description
schema string yes Name of the schema to create records under. Workflow YAML sets this via the schema: key (the Python field is schema_name).
file_field string yes Field on the created records to store each file reference in.
dataset string no "" Dataset to create records in. Empty string falls back to the trigger record's own dataset.
context_record_id string no "" Parent record ID to attach created records to. Empty string falls back to the workflow's context record.

Inputs

Name Type Required Description
files files yes FileRef dicts to create one record from each.

Outputs

Name Type Required Description
created number yes Records created.
skipped number yes Files whose record failed validation.
inputs:
  files:
    type: files
    label: Recording files

steps:
  - id: insert
    plugin: civex.create_records_from_files
    config:
      schema: Recording
      file_field: audio_file
    inputs:
      files: __input__.files