Integration guide
n8n integration: a polling loop with HTTP Request, Wait and IF
n8n has no special node for GateSolver and does not need one: two HTTP Request nodes, a Wait node and two IF nodes make a solve loop you can reuse in every workflow.
The shape of the loop
A solve in n8n is a small cycle. One HTTP Request node opens the task, a Wait node pauses, a second HTTP Request node asks for the result, and IF nodes decide whether to continue, finish, or stop with an error. Built once as a sub-workflow, the loop serves every workflow that needs an answer, whatever the CAPTCHA type. The type only changes the task fields you send in and the solution field you read out.
Polling is the only way to receive the answer: GateSolver does not call your workflow back, so the loop is not a workaround but the intended pattern. With a three second wait, a reCAPTCHA v2 task ($0.56 per 1,000) usually finishes in a handful of rounds. Our type specific walkthroughs build complete flows for reCAPTCHA, Turnstile and AWS WAF; this page is the reference for the loop they share.
Before you start
- n8n 1.x, self hosted or cloud. Labels below match the 1.x editor at the time of writing; if an option has moved, the n8n docs list its new place.
- An API key, saved where your workflows can read it. On plans with variables, a variable such as
GS_API_KEYkeeps it out of exported workflow files. - The task inputs from earlier nodes: the page URL, the site key, and the task type. If you scrape the page in n8n first, an HTML node with a CSS selector on
[data-sitekey]and the attributedata-sitekeypulls the key out without code.
Building the sub-workflow
Start the sub-workflow with an Execute Workflow Trigger (the trigger is labeled "When Executed by Another Workflow" in recent versions) so other workflows can call it with an Execute Workflow node. Expect three input fields: task_type, target_url and widget_key. Then add the nodes in this order.
Open task (HTTP Request)
Method POST, URL https://gatesolver.com/createTask, Send Body on, body content type JSON, specified as JSON. Under Options, turn on Never Error so an unexpected status still produces an item you can inspect, rather than halting the execution.
{
"clientKey": "{{ $vars.GS_API_KEY }}",
"task": {
"type": "{{ $json.task_type }}",
"websiteURL": "{{ $json.target_url }}",
"websiteKey": "{{ $json.widget_key }}"
}
}
For types with extra fields, such as pageAction for reCAPTCHA v3 or metadata for Turnstile, add them here or pass a whole task object from the caller and reference it as {{ JSON.stringify($json.task) }} in place of the inner block.
Opened? (IF)
Check that {{ $json.errorId }} equals 0. The false branch goes to a Stop and Error node whose message includes {{ $json.errorCode }}. Errors at this stage are configuration problems (a wrong key, a zero balance, a missing field named in the description), so looping would only repeat them.
Hold (Wait) and Read result (HTTP Request)
The Wait node resumes after a time interval of 3 seconds. Short waits like this keep the execution in memory rather than parking it in the database, which suits a loop of many quick rounds. The second HTTP Request node posts to /getTaskResult, again with Never Error on.
{
"clientKey": "{{ $vars.GS_API_KEY }}",
"taskId": {{ $('Open task').first().json.taskId }}
}
Finished? (IF) {{ $json.status }} is equal to ready
Gave up? (IF) {{ $json.status === 'failed' || $json.errorId > 0 || $runIndex >= 40 }} is true
Answer (Set) token = {{ $json.solution.gRecaptchaResponse ?? $json.solution.token }}
The task id is read from the Open task node by name, not from $json. After the first round, the item flowing into Read result is the previous poll reply, which has no task id, so a plain $json.taskId works once and then breaks. Keep the node names in your expressions in sync if you rename nodes. Leave taskId unquoted so it keeps the type the API returned.
Closing the loop
Connect Finished? true to the Answer node, which ends the sub-workflow and returns the token to the caller. Connect Finished? false to Gave up?. Its true branch goes to Stop and Error, and its false branch goes back to Hold, which forms the loop. $runIndex counts how many times the current node has run in this execution, so 40 rounds of three seconds is a little over the 120 seconds after which an unsolved task is marked failed (and free) on our side.
Feeding the loop and using its output
The caller decides where the inputs come from and where the answer goes. A typical monitoring flow fetches a public page with HTTP Request, extracts the key with the HTML node, calls the sub-workflow, then submits the page's form with another HTTP Request that includes the token in g-recaptcha-response or cf-turnstile-response. Keep the cookies from the first fetch and send them with the submit; many sites tie the form to the visit. For cookie type answers, such as AWS WAF, the Answer node should return solution.cookie instead, and the caller adds it as a cookie header on the next request.
Act on the answer straight away. Tokens age from the moment they are issued, so do not place slow nodes, approvals or long waits between the sub-workflow and the submit.
Errors and retries
Three layers handle failures. HTTP Request nodes can use Retry On Fail in their settings for network level problems such as timeouts. The Opened? branch stops on configuration errors. Gave up? stops on failed or unsolvable tasks, which cost nothing. If you want one automatic second attempt for unsolvable tasks, call the sub-workflow from the parent inside an error branch once, not inside the loop. For temporary ERROR_SERVICE_UNAVAILABLE or ERROR_RATE_LIMIT replies during polling, the loop can simply continue: route those to Hold rather than to Gave up?, and the next round will usually succeed.
Set an Error Workflow in the workflow settings so a Stop and Error sends you a message with the error code and execution link.
Scaling notes
If many items enter the sub-workflow at once, the expression $('Open task').first() would hand every item the first task id. Put a Loop Over Items node (formerly Split in Batches) in the caller with a batch size of 1, or call the sub-workflow once per item, so each run owns one task. To run solves in parallel, start several executions instead, for example from a queue or a webhook per job. Concurrent tasks have no cap on our side; the limit to watch is 600 requests per minute per key, roughly 40 three second loops running at the same moment. On self hosted n8n in queue mode, workers share that one key, so size the worker count with that budget in mind.
Use the loop for jobs you are allowed to automate: price checks on public pages, form tests on your own sites, internal RPA. For the bigger picture of no-code setups, see CAPTCHA handling in no-code tools.
Common questions
Do I need a community node to use GateSolver in n8n?
No. The built in HTTP Request node is all the integration needs, and GateSolver does not publish an n8n node.
Why does the second poll lose the task id?
Each loop round passes the previous poll reply forward, and that reply has no taskId. Read it from the Open task node by name instead.
Can I use a Code node instead of the loop?
Yes, a Code node can poll with the request helper. The node loop is easier to see and debug on the canvas, which is why this guide uses it.
How long should the Wait node pause?
Three seconds for token tasks and one second for image tasks; shorter pauses only spend more of the per key request budget.
Where should the API key live in n8n?
In a variable or a credential the HTTP Request node references, never typed into node fields that end up in shared workflow exports.
Keep reading
- Solve reCAPTCHA in an n8n workflowAn n8n workflow that creates a reCAPTCHA v2 or v3 task, checks it in a loop and passes the token onward.
- Solve Cloudflare Turnstile in n8nAn n8n workflow that reads the Turnstile site key from the page, requests a token and sends the follow-up request.
- Can no-code tools handle CAPTCHAs?Yes, through HTTP request steps: create a task, wait, poll for the answer, then pass it to the next node.
- Task pollingAsking getTaskResult for an answer on a timer: sensible intervals for token and image tasks, and when to give up.