Skip to content

Worker error: body must be a map #1166

Open

Description

@josephjclark

This weird error caused a lost run:

✘ e8ed3956-8cc6-4a19-9634-fc57dfdd4823 :: step:complete :: ERR: [step:complete] {"body":["must be a map"]}

link to app

I can only think that somehow the step has sent an invalid structure as the dataclip body

The job code is strange but harmless, so far as I can see (I've tried breaking it down into a repro, but failed)

each('$.cachedData[*]',
    state => Object.entries(state.data.value.rawData),
    fn(state => {
      const [tableName, rows] = state.data;
      
      // Define the order to respect foreign keys
      const insertOrder = ['person', 'patient', 'person_name', 'person_address', 'patient_identifier'];
      
      // Only process if this table is in our current batch
      if (insertOrder.includes(tableName)) {
        console.log(`Processing ${tableName} with ${rows.length} rows`);
        return { ...state, tableName, rows };
      }
      
      console.log(`Skipping ${tableName} - not in insert order`);
      return upsertMany(
      state => state.tableName,
      state => state.rows
    )(state)
    }),
    
  )

Activity

  1. moved this from New Issues to DevX Backlog in Coreon Dec 15, 2025
  2. moved this from DevX Backlog to Product Backlog in Coreon Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status
      Product Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions