WORKFLOW · N8N
DataForge Lite — Single URL AI Scraper
Prompts👁 4
WORKFLOW JSON
{
"meta": {
"instanceId": "dataforge-lite-v1"
},
"name": "DataForge Lite — Single URL AI Scraper",
"tags": [
{
"id": "dataforge",
"name": "DataForge"
},
{
"id": "autoflow",
"name": "AutoFlow"
},
{
"id": "lite",
"name": "Lite"
}
],
"nodes": [
{
"id": "trigger",
"name": "Scrape URL",
"type": "n8n-nodes-base.webhook",
"position": [
200,
400
],
"webhookId": "dataforge-lite",
"parameters": {
"path": "dataforge-lite",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "validate",
"name": "Validate",
"type": "n8n-nodes-base.code",
"position": [
400,
400
],
"parameters": {
"jsCode": "try {\n const b = $input.first().json.body || $input.first().json;\n if (!b.url) throw new Error('URL is required.');\n return [{ json: { url: b.url, extractFields: b.extract_fields || 'price,features,description', name: b.name || '' } }];\n} catch (e) { throw new Error('Invalid input: ' + e.message); }"
},
"typeVersion": 2
},
{
"id": "fetch",
"name": "Fetch Page",
"type": "n8n-nodes-base.httpRequest",
"maxTries": 2,
"position": [
600,
400
],
"parameters": {
"url": "={{ $json.url }}",
"method": "GET",
"options": {
"timeout": 20000
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "User-Agent",
"value": "Mozilla/5.0 (compatible; DataForge/1.0)"
}
]
}
},
"retryOnFail": true,
"typeVersion": 4.2,
"continueOnFail": true
},
{
"id": "extract",
"name": "Extract Text",
"type": "n8n-nodes-base.code",
"position": [
800,
400
],
"parameters": {
"jsCode": "try {\n const url = $('Validate').first().json;\n const r = $input.first().json;\n const html = typeof r === 'string' ? r : (r.data || r.body || JSON.stringify(r));\n const text = html.replace(/<script[^>]*>[\\s\\S]*?<\\/script>/gi,'').replace(/<style[^>]*>[\\s\\S]*?<\\/style>/gi,'').replace(/<[^>]+>/g,' ').replace(/\\s+/g,' ').trim().substring(0,4000);\n return [{ json: { ...url, pageText: text } }];\n} catch(e) { throw new Error('Extract failed: ' + e.message); }"
},
"typeVersion": 2
},
{
"id": "ai",
"name": "AI: Extract Data",
"type": "n8n-nodes-base.openAi",
"maxTries": 3,
"position": [
1020,
400
],
"parameters": {
"model": "gpt-4o-mini",
"options": {
"maxTokens": 800,
"temperature": 0.2,
"responseFormat": "json_object"
},
"messages": {
"values": [
{
"role": "system",
"content": "=Extract from the page: {{ $json.extractFields }}. Also: title, description, stats, sentiment. JSON: { \"title\": \"\", \"description\": \"\", \"extractedData\": {}, \"statistics\": [], \"sentiment\": \"\" }"
},
{
"role": "user",
"content": "=URL: {{$json.url}}\nExtract: {{$json.extractFields}}\n\nContent:\n{{$json.pageText}}"
}
]
}
},
"retryOnFail": true,
"typeVersion": 1.8,
"waitBetweenTries": 2000
},
{
"id": "respond",
"name": "Respond",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1240,
400
],
"parameters": {
"respondWith": "json",
"responseBody": "={{ $input.first().json.message?.content || $input.first().json.content || '{}' }}"
},
"typeVersion": 1.1
},
{
"id": "note",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
120,
220
],
"parameters": {
"color": 6,
"width": 260,
"height": 100,
"content": "## DataForge Lite\nPOST a URL, get structured data.\nNo Sheets, no schedule."
},
"typeVersion": 1
}
],
"settings": {
"executionOrder": "v1",
"saveManualExecutions": true
},
"connections": {
"Validate": {
"main": [
[
{
"node": "Fetch Page",
"type": "main",
"index": 0
}
]
]
},
"Fetch Page": {
"main": [
[
{
"node": "Extract Text",
"type": "main",
"index": 0
}
]
]
},
"Scrape URL": {
"main": [
[
{
"node": "Validate",
"type": "main",
"index": 0
}
]
]
},
"Extract Text": {
"main": [
[
{
"node": "AI: Extract Data",
"type": "main",
"index": 0
}
]
]
},
"AI: Extract Data": {
"main": [
[
{
"node": "Respond",
"type": "main",
"index": 0
}
]
]
}
}
}RELATED WORKFLOWS
COMMENTS
No comments yet — be the first.
