Skip to main content

Collect historical price data from Polymarket Up/Down markets into Supabase

Workflow preview

Workflow preview
100%
Collect historical price data from Polymarket Up/Down markets into Supabase preview
Open on n8n.io

1. Workflow Overview

This workflow automatically collects historical price data from Polymarket Up/Down markets and stores it in Supabase, creating a structured and query ready dataset for analysis. By continuously fet...

Best for

  • Crypto Trading automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.formtrigger, n8n-nodes-base.httprequest, n8n-nodes-base.splitout, n8n-nodes-base.datatable, n8n-nodes-base.manualtrigger, n8n-nodes-base.if, n8n-nodes-base.datetime, n8n-nodes-base.set

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Caio Carvalho.

Original n8n.io source

1.1 Workflow description

Title
Collect historical price data from Polymarket Up/Down markets into Supabase
Workflow name
Collect historical price data from Polymarket Up/Down markets into Supabase

This workflow automatically collects historical price data from Polymarket Up/Down markets and stores it in Supabase, creating a structured and query-ready dataset for analysis. By continuously fetching price movements from prediction markets such as Bitcoin, S&P 500, and other Up/Down series, the automation enables reliable historical tracking without manual intervention. The data is normalized and persisted in Supabase, making it easy to run SQL queries, build dashboards, perform quantitative analysis, or integrate with analytics and AI pipelines. This setup is ideal for traders, data analysts, and developers who need accurate Polymarket price history for research, strategy testing, or long-term market monitoring

How it works

  • Provide the slug of the serial market you want to analyze in the initial form. The workflow is designed for live Polymarket “Up or Down” markets; copy the slug from the current market and submit it.

  • From the slug, the workflow extracts the event ID and derives the corresponding series ID. All events in that series are retrieved, organized, and stored in an internal n8n table. This process runs only once per series to avoid duplicate data.

  • A second workflow reads the stored events, retrieves the Up and Down token IDs, records market closing times, and filters out open markets so only historical data is processed.

  • Market end times are converted to Unix timestamps, and start times are calculated. The workflow is structured for 1-hour markets, but the time-conversion node can be adjusted for other durations.

  • Historical price data is then fetched and stored in a Supabase table for later analysis.

How to use

  • Copy the slug of the desired Up or Down market from Polymarket and submit it through the form.

  • After the first workflow finishes, run the second workflow to collect historical price data.

  • Events are processed in batches of 100 to avoid performance issues. If execution stops, simply rerun the workflow and it will continue from where it left off.

Need help with implementation or customization?

If you require assistance setting up this workflow, adapting it to your infrastructure, or extending it for advanced analytics, feel free to reach out by email at [email protected] .

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Form to include slug of the market

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.3

Block 2 - Find the Event ID from the Slug

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 3 - Find the Series ID from the slug

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 4 - Find All the Events for that Series ID

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 5 - Split Events into Itens

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 6 - Register Events in Table Polymarket_Btc_1h_Event_List_1

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 7 - Start Getting Prices Data

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 8 - Fetch 100 unprocessed events

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 9 - Fetch UP/DOWN tokens and end time

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 10 - Store UP/DOWN tokens and end time

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 11 - Check if market has closed

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 12 - Mark open markets as processed

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 13 - Convert end time to Unix timestamp

Type / Role
n8n-nodes-base.dateTime - dateTime
Config choices
Version 2

Block 14 - Convert end time to numeric and set start time

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 15 - Fetch price history

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 16 - Split prices and timestamps into arrays

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 17 - Store in Supabase

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 18 - Mark as processed

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 19 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Collect historical price data from Polymarket Up/Down markets into Supabase
Complexity advanced
Nodes 23
Categories Crypto Trading
Author Caio Carvalho
Published 19 Jan 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/12823/12823.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Collect historical price data from Polymarket Up/Down markets into Supabase do?

This workflow automatically collects historical price data from Polymarket Up/Down markets and stores it in Supabase, creating a structured and query ready dataset for analysis. By continuously fet...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Crypto Trading use case.