Before you start
- A Business, Agency Business or Enterprise plan, and an API token with write access enabled by an Owner or Manager. See Writing data.
- A sheet with one row per prompt: a stable
rowId, thetext, and optionally a topic and a frequency. - In n8n, a Header Auth credential with the name
Authorizationand the valueBearer <your token>. Never put the token in a node parameter or a workflow export. - n8n interface labels change between versions. The stable inputs are the URL, the headers and the body of each request. See the n8n HTTP Request node documentation.
Workflow outline
Read the current state
Request the configuration view so archived prompts and versions are included:offset until pagination reports no more results. The configuration view returns id, text, status, frequency, monitoringEnabled, keywordId, tagIds and version for each prompt. See List prompts.
Compute the changes
This Code node (JavaScript) matches rows to prompts by normalized text and emits a create or an update. The hash is only used to build a deterministic idempotency key.Write the changes
Create with a deterministic key:Idempotency-Key and no If-Match, and returns an outcome for each prompt that you must inspect.
Make replays safe
- Idempotency. The same key with the same body returns the original response for 24 hours, with
Idempotent-Replay: true. The same key with a different body returns409IDEMPOTENCY_CONFLICT, which is why the key above includes a hash of the content. A409IDEMPOTENCY_IN_PROGRESSmeans the outcome is unknown: read the prompts again before you continue. - If-Match. A
412PRECONDITION_FAILEDmeans someone changed the prompt after your read. Do not retry with the old version. Run the sync again so it reads fresh versions. A428means the header is missing. - Duplicates. After 24 hours a replayed create is no longer recognized and returns
409CONFLICTfor a duplicate text. Reading first, as this workflow does, turns that case into a no-op, and restores an archived prompt instead of recreating it. - Rate limit. Writes are limited to 120 per minute per team. Send one change per iteration and add a Wait node. On
429, wait forRetry-Afterseconds before retrying, and use the same key for a create. On503SERVICE_UNAVAILABLEnothing changed: retry with bounded backoff. - Errors. Set the write node to continue on error and route failures to a log, so one bad row does not stop the batch.
Verify
Run the workflow twice. The second run should emit no changes. Then list prompts withview=configuration and compare the rows with the result.
Limits
- The sync never deletes prompts: removed rows are not archived unless you add that rule. Archiving keeps answers and history.
- New monitored prompts add recurring credit use. Check Credits before a large import.

