n8n workflows
n8n Data Tables as a URL queue: status, attempts, fetched_at
Keep a URL list in an n8n data table with one status row per URL, so each scheduled run sends only the pages that are due and every failure stays visible.
By Caitlin Sanders, AgentScraper team · Published
This article was drafted with AI assistance from the sources listed below and edited and published by the AgentScraper team. Disclosure: the AgentScraper API, which this article mentions, is this site's own product.
- 1Reset stale rowsUpdate: status done and fetched_at older than 24 hours becomes pending.
- 2Get due rowsGet: status Equals pending, with a Limit you choose.
- 3FetchYour HTTP Request step reads the pages.
- 4Write backUpdate each row: status, attempts, fetched_at, error_tag.
Your URL list lives in a Google Sheet. Every run reads the sheet, fetches every row and writes a status back. Then the list grows, the run writes one status per URL, and the Sheets API answers 429. Google's documented quota is 60 write requests per minute per user per project, and 300 per minute per project.
n8n has storage of its own now: data tables. They sit inside your n8n project, so the queue's reads and writes never touch the Sheets quota. This walkthrough builds a URL queue on one table: one row per URL, a status, an attempt count and the time of the last good fetch. Each scheduled run sends only the rows that are due.
What a data table is, and what it is not
A data table is tabular storage scoped to an n8n project. The docs call it "suitable for light to moderate data storage." Four facts shape the design:
- All data tables in an instance share one cap: 200 MiB by default. Self-hosted, you change it with
N8N_DATA_TABLES_MAX_SIZE_BYTES. - n8n warns at 80% of the cap and again when you reach it. At the cap, executions that insert or update data fail.
- A table belongs to one project. The Data Table node rejects tables from other projects.
- A Code node cannot read table values directly.
The cap is the one that bites a scraper. If you store page bodies in the queue, the table fills up, and then the status updates fail with it. Store state in the table. Send the Markdown to wherever your AI step reads it.
Step 1: create the table
Open your project. Select the "Data tables" tab. Click the split button in the top right and choose "Create Data table". Name it url_queue and pick "From scratch".
Add five columns. The node offers four types: "Boolean", "Date", "Number" and "String".
| Column | Type | Holds |
|---|---|---|
url | String | the page address, normalized |
status | String | pending, done or failed |
attempts | Number | runs in a row that ended in an error |
fetched_at | Date | time of the last good fetch |
error_tag | String | the last error, empty after a success |
What you see: an empty table with five column headers.
Step 2: add new URLs without duplicates
New URLs arrive from a form, a sitemap or another workflow. Put this workflow in the same project as the table.
Add a Data Table node. Set "Resource" to "Row" and "Operation" to "If Row Does Not Exist". Pick url_queue under "Data table". Click "Add Condition". Set "Column" to url, "Condition" to "Equals" and "Value" to {{ $json.url }}.
Connect a second Data Table node. Set "Operation" to "Insert". Map url, set status to pending and attempts to 0. Turn on "Optimize Bulk" under "Options" if you do not need the inserted rows back.
What you see: a URL that is already in the table stops at the first node. A new one becomes a pending row.
Step 3: reset rows that are due again
Start the collection workflow with your schedule. The first Data Table node turns old successes back into work.
Set "Operation" to "Update". Set "Must Match" to "All Conditions". Add status "Equals" done. Add fetched_at "Less Than" {{ $now.minus({hours: 24}) }}. Map status to pending.
$now is a Luxon object with the current timestamp. Swap 24 hours for your own refresh window. Turn on "Dry Run" under "Options" for the first test.
What you see: rows fetched more than 24 hours ago flip to pending. Fresh rows stay done.
Step 4: get only what is due
Add a Data Table node with "Operation" set to "Get". Add the condition status "Equals" pending. Turn off "Return All" and set "Limit" to the number of URLs one run can finish. Turn on "Order By", pick fetched_at and set the direction to ascending, so the oldest pages go first.
What you see: at most "Limit" items, all pending. A run that stops halfway leaves the rest pending for the next run.
Step 5: fetch, then write one status per URL
Send the items through your HTTP Request step, as in the n8n web scraping guide. After it, add a Data Table node with "Operation" set to "Update". Add a condition on url "Equals" the row's URL from the Get node. Map the four state columns from the result.
Which errors count as retryable is the job of your retry rules. This site keeps them in one place: the retry rules table. The queue only records the outcome:
| Result for the URL | status | attempts | fetched_at | error_tag |
|---|---|---|---|---|
| Page fetched | done | 0 | fetch time | empty |
| Retryable error, fewer than 3 runs in a row | pending | +1 | unchanged | the tag |
| Retryable error on the 3rd run in a row | failed | 3 | unchanged | the tag |
| Any other per-URL error | failed | +1 | unchanged | the tag |
Account error (401, 402, 403) | stop the job, write nothing |
What you see: every URL from the run has a row that says what happened. Nothing disappears into an execution log.
If your HTTP step is the AgentScraper API, each URL comes back with a per-URL status and its fetch time in statuses[].fetchedAt. Map that value to fetched_at. Failed pages come back with an error tag you can route on, and "Failed fetches cost 0 credits." The request setup for n8n is in the no-code recipes.
What this means for your workflow
- A late, doubled or crashed run costs little. Step 3 only resets rows older than your window, and step 4 only sends
pendingrows. failedrows wait for a person. Filter the table onstatusand you have the review list.- Watch the 80% warning. The queue holds a few short strings per URL, so a full instance usually means something else is storing bodies.
- You can open the table's three-dot menu and choose "Download CSV" for a snapshot before you change the design.
What the table cannot do: it does not pace requests, and it cannot be read from a Code node. Pacing stays in the HTTP step. Pass rows to code as items from a Data Table node.
Frequently asked questions
How much can n8n data tables store?
By default, all data tables in one n8n instance share 200 MiB of storage. Self-hosted instances can change it with the N8N_DATA_TABLES_MAX_SIZE_BYTES environment variable. n8n warns at 80% and again at the limit.
What happens when an n8n data table is full?
At the cap, manual additions are disabled and workflow executions that insert or update data fail. In a URL queue that means the status updates fail too, so keep page bodies out of the table.
Can a Code node read an n8n data table?
No. The n8n docs say a Code node cannot access data table values directly and there are no built-in methods or variables for it. Use the Data Table node and pass the rows in.
Can two n8n projects share one data table?
No. A table belongs to one project and cannot be shared on its own. The Data Table node only uses tables from its own project, so the seeding and collection workflows must live in the same project.
Sources
- Data tables (Documentation)
- Data table node: row operations (Documentation)
- Data table node: table operations (Documentation)
- Date and time with Luxon (Documentation)
- Google Sheets API usage limits (Documentation)