Skip to main content
A query-based source, read on a schedule. Direct queries are fine for the incremental run; the initial backfill is better served by UNLOAD to S3, which parallelises across slices instead of funnelling through the leader node.

What you need

  • A user with SELECT on the source tables
  • An Octave workspace API key, from Settings → Integrations
  • An AWS account to deploy into

Where this runs

A scheduled Lambda covers the hourly incremental run. The backfill is a different job: UNLOAD to S3, then read the resulting Parquet from a Fargate task — which is the same shape as the S3 flow.

The prompt

Copy this into Claude Code, Cursor or any coding agent. It carries the whole flow — reading your warehouse, mapping the columns, posting to Octave, and deploying the result. Fill in section 1 with your real schema and a few sample rows (SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'opportunities' plus SELECT * … LIMIT 5). The more of your actual data it can see, the less it has to guess.
The instruction to show the mapping as a table and wait for confirmation is the part worth keeping. Without it an agent guesses at your column names and buries the guess inside a handler, where a wrong eventType looks exactly like a right one until the data is in.

Hints worth adding

These are the things that go wrong with Amazon Redshift specifically. Paste whichever apply into section 1 of the prompt — an agent cannot infer them from a schema. A direct cursor is the wrong tool for the backfill. Everything funnels through the leader node. UNLOAD to S3 parallelises across slices and is usually an order of magnitude faster end to end — worth naming so the AI does not build one slow path for both jobs. DECIMAL(18,2) loses precision through JSON. Ask for a cast to VARCHAR and amount sent as a string. VARCHAR columns truncate quietly. Email bodies overflow a declared byte length without an error. Say what the declared width is if you know it, so the AI can flag rows that hit it rather than importing silently-clipped text.