n8n-script-agent / script-agent.json
Mariaxcn's picture
Rename script-agent.json.json to script-agent.json
674be8c verified
Raw History Blame Contribute Delete
4.7 kB
{
"name": "script-agent.json",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"daysInterval": 5,
"triggerAtHour": 9
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.3,
"position": [
-576,
32
],
"id": "820ad7b8-75a7-4d90-9cb9-dde3fcdb0b6a",
"name": "Schedule Trigger"
},
{
"parameters": {
"method": "POST",
"url": "https://api.groq.com/openai/v1/chat/completions",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer 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"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"model\": \"llama-3.3-70b-versatile\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Create a finance video script (500-800 words). Choose a UNIQUE topic from this list: budgeting, saving money, investing for beginners, debt repayment, emergency funds, retirement planning, side hustles, credit score, financial freedom, frugal living, taxes, real estate investing, student loans, mortgage tips, car buying, insurance savings, or grocery budgeting.\\n\\nUse the topic: {{Date.now() % 20}}. Pick the topic based on this number.\\n\\nFormat:\\nFirst line: 'SEO KEYWORDS:' then 5 keywords.\\nThen 'SCRIPT:' then the script.\\n\\nIn the script include:\\n- VIRAL HOOK (first 5-10 seconds) - must stop scrolling\\n- PROBLEM\\n- SOLUTION\\n- 3 KEY POINTS with real examples\\n- CALL TO ACTION\\n\\nMake it completely different from typical finance scripts. Use fresh angles, surprising statistics, or contrarian views. Format as continuous voiceover with ONLY spoken words. No timestamps, no labels.\"\n }\n ]\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
-144,
32
],
"id": "ba97c1d9-3686-4a53-a143-8ab46e38d3eb",
"name": "HTTP Request1"
},
{
"parameters": {
"sendTo": "mariaajames280@gmail.com",
"subject": "🎬 New Finance Script",
"emailType": "text",
"message": "={{$node[\"HTTP Request1\"].json.choices[0].message.content}}",
"options": {}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.2,
"position": [
64,
32
],
"id": "d84ec7ae-3282-42b7-9196-656bffdf4c4b",
"name": "Send a message",
"webhookId": "be4f5227-cfc0-4a2b-b274-a4f98c96df48",
"credentials": {
"gmailOAuth2": {
"id": "UMvduKDcAbWxjmNK",
"name": "Gmail account"
}
}
},
{
"parameters": {
"jsCode": "const topics = [\n \"budgeting for beginners\",\n \"how to save $10,000 fast\",\n \"investing with $100 a month\",\n \"pay off credit card debt\",\n \"build an emergency fund\",\n \"retirement planning in your 20s\",\n \"side hustles that pay\",\n \"improve your credit score\",\n \"financial freedom steps\",\n \"frugal living tips\"\n];\n\nconst randomIndex = Math.floor(Math.random() * topics.length);\nconst randomTopic = topics[randomIndex];\n\nreturn { topic: randomTopic };"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-368,
32
],
"id": "387b2fdb-2e4e-4a16-8807-fda3face2da0",
"name": "Code in JavaScript"
}
],
"pinData": {},
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "Code in JavaScript",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request1": {
"main": [
[
{
"node": "Send a message",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript": {
"main": [
[
{
"node": "HTTP Request1",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1",
"binaryMode": "separate"
},
"versionId": "c4f51403-00e1-4feb-ba6d-dc6cb476e6e7",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "c5fb64c0035bc94075d79019bfa2c1429a80dbb6e9fd3b850964246ec8ebdf03"
},
"id": "m8IOca9a1IsWLyB3",
"tags": []
}