Skip to content
AdlyseDocs
Product guideMCP reference
⌘K
Open Adlyse
⌘K
Overview
QuickstartAuthentication
adlyse-insights
adlyse-ads
adlyse-workflows
list_workflowsget_workflowrun_workflowget_run_statusget_node_runget_workflow_schemacreate_workflowupdate_workflowdelete_workflowcreate_releaselist_releasesset_production_releasedelete_releaselist_authoring_resourceslist_tablesget_tablequery_table_rowscreate_tableadd_table_columnsadd_table_rowsupsert_table_rowsupdate_table_rowsdelete_table_rowsupdate_tabledelete_tableupdate_table_columndelete_table_columnreorder_table_columnslist_schedulesget_schedulecreate_scheduleupdate_schedulepause_scheduleresume_scheduledelete_scheduletrigger_schedulerun_assistantget_assistant_runlist_assistant_threadsget_assistant_threadlist_assistantsget_assistantcreate_assistantupdate_assistantdelete_assistantlist_assistant_handoffscreate_assistant_handoffupdate_assistant_handoffdelete_assistant_handofflist_filesread_filegrep_fileswrite_fileedit_filemove_filearchive_filelist_file_versionspromote_file_versionlist_skillsget_skillcreate_skillupdate_skilldelete_skillassign_skill_to_assistantremove_skill_from_assistantlist_agent_resourcesstart_batch_taskget_batch_taskcontrol_batch_task
adlyse-admin
adlyse-all
  1. Overview
  2. adlyse-workflows

upsert_table_rows

Add rows, or update the ones that already exist — the repeatable write.

Use this instead of add_table_rows whenever the same logical row could be written more than once: anything on a schedule, anything retried, anything keyed by a period. add_table_rows always appends, so a second run of the same job duplicates its rows and every later reader counts them twice.

A row matches an existing one when EVERY dedup_keys column holds the same value; matched rows are updated in place, unmatched rows are created.

Args: table_id: The table id (e.g. “dtbl_abc123”) rows: JSON array of {column_key: value} objects dedup_keys: JSON array of column keys identifying a row, e.g. [“channel”, “month”]. Every key must have a value in every row.

Returns: {table_id, created, updated, row_ids}

Errors rather than guessing when a dedup key is unknown, a row is missing one, two rows in the batch share a key, or more than one existing row already matches.

Parameters#

NameTypeRequiredDefaultDescription
table_idstringyesThe table id (e.g. “dtbl_abc123”)
rowsanyyesJSON array of {column_key: value} objects
dedup_keysanyyesJSON array of column keys identifying a row, e.g. [“channel”, “month”]. Every key must have a value in every row.

Generated by generate_mcp_docs from the server tool. Add to this page below this block; the block is rewritten on every run.

Previousadd_table_rowsNextupdate_table_rows