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 samples.

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: read, write_records

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 The file field of each new record.
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 The files to make records from, one record each.

Outputs

Name Type Required Description
created number yes How many records it made.
skipped number yes The files whose record could not be made.
inputs:
  files:
    type: files
    label: Reading files

steps:
  - id: insert
    plugin: civex.create_records_from_files
    config:
      schema: Sample
      file_field: reading
    inputs:
      files: __input__.files