Automation library · Data collection

Collect historical price data

Started by someone submitting a form, and works across Supabase and n8n data table. 18 steps, 1 branch: a working afternoon to understand properly.

Medium

18 stepsMedium: a working afternoon
1Branch: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 2Logic 5Service 11

The steps in the order they run, from what starts it.

  1. 1Form to include slug of the marketForm triggerStarts it
  2. 2Start Getting Prices DataManual triggerStarts it
  3. 3Find the Event ID from the SlugHttp RequestService
  4. 4Fetch 100 unprocessed eventsData TableService
  5. 5Find the Series ID from the slugHttp RequestService
  6. 6Fetch UP/DOWN tokens and end timeHttp RequestService
  7. 7Find All the Events for that Series IDHttp RequestService
  8. 8Store UP/DOWN tokens and end timeData TableService
  9. 9Split Events into ItensSplit OutLogic
  10. 10Check if market has closedIfLogic
  11. 11Register Events in Table Polymarket_Btc_1h_Event_List_1Data TableService
  12. 12Mark open markets as processedData TableService
  13. 13Convert end time to Unix timestampDate TimeLogic
  14. 14Convert end time to numeric and set start timeSetLogic
  15. 15Fetch price historyHttp RequestService
  16. 16Split prices and timestamps into arraysSetLogic
  17. 17Store in SupabaseSupabaseService
  18. 18Mark as processedData TableService

How it's built

Starts on
Someone submitting a form
Steps
18, with 1 branch
Size
Medium: a working afternoon
Connects to
Supabase, n8n data table
Model
None. This is plumbing, not judgement

Questions

What does it need to run?

An n8n account, plus your own Supabase account. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone submitting a form.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Plan an afternoon. 18 steps is enough that you should read each one before running it.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 18 steps before you point it at anything that matters.