Skip to main content
Treat a spreadsheet as the source of truth for a workspace’s prompts and apply the differences through the REST API. This guide uses the generic HTTP Request node of n8n, so it needs no community node. The same logic works in any automation tool that can send HTTP requests.

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, the text, and optionally a topic and a frequency.
  • In n8n, a Header Auth credential with the name Authorization and the value Bearer <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.
All values are synthetic.

Workflow outline

Read the current state

Request the configuration view so archived prompts and versions are included:
Page with 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:
Update or restore with the version you just read, quoted:
For many identical changes, such as archiving or changing the frequency of up to 20 prompts, bulk update prompts is one request. It uses an 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 returns 409 IDEMPOTENCY_CONFLICT, which is why the key above includes a hash of the content. A 409 IDEMPOTENCY_IN_PROGRESS means the outcome is unknown: read the prompts again before you continue.
  • If-Match. A 412 PRECONDITION_FAILED means someone changed the prompt after your read. Do not retry with the old version. Run the sync again so it reads fresh versions. A 428 means the header is missing.
  • Duplicates. After 24 hours a replayed create is no longer recognized and returns 409 CONFLICT for 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 for Retry-After seconds before retrying, and use the same key for a create. On 503 SERVICE_UNAVAILABLE nothing 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 with view=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.