{
  "id": "gONpHTHkittovaKB",
  "name": "[TEMPLATE] General Research & Tool-Use Agent for Animal Advocacy",
  "tags": [],
  "nodes": [
    {
      "id": "02b995de-4739-4c8a-9f2f-152f4a8656d6",
      "name": "Serper API",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        -1060,
        560
      ],
      "parameters": {
        "url": "https://google.serper.dev/{endpoint}",
        "sendQuery": true,
        "sendHeaders": true,
        "specifyQuery": "model",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "toolDescription": "Performs live Google searches and returns featured snippets, organic results, FAQs, maps, and more. Best for up-to-date information and broad query coverage.\n\nTo search using Google Search through Serper API:\n\n## Endpoint\n\nYou must specify one of these endpoints:\n\n- search (general web search)\n- news (news articles)\n- maps (location-based)\n- reviews (business reviews)\n- scholar (academic papers)\n- patents (patent searches)\n\n## Query Paramaters\n\nThe body should be a single object with these parameters:\n\nFor General Search, News, Scholar, Patents:\n{\n\"q\": \"search query\",\n\"location\": \"geographic location\",  // optional\n\"tbs\": \"time parameter\"            // optional\n}\nFor Maps:\n{\n\"q\": \"search query\",\n\"ll\": \"@latitude,longitude,zoom\"   // required\n}\nFor Reviews:\n{\n\"q\": \"search query\"\n}\n\nParameter Details\nQuery (q)\n\nRequired for all search types\nMust be a specific search term or phrase\nExample: \"q\": \"tesla stock price\" or \"q\": \"restaurants in new york\"\n\nLocation\n\nOptional for search, news, scholar, patents\nFormat: Country or city name\nExample: \"location\": \"United States\"\n\nTime Parameter (tbs)\n\nOptional for search, news, scholar, patents\nValues:\n\n\"tbs\": \"qdr:d\" (past day)\n\"tbs\": \"qdr:w\" (past week)\n\"tbs\": \"qdr:m\" (past month)\n\"tbs\": \"qdr:y\" (past year)\n\nCoordinates (ll)\n\nRequired for maps searches only\nFormat: \"@latitude,longitude,zoom\"\nExample: \"ll\": \"@40.6973709,-74.1444871,11z\"\n\nUsage Guidelines\n\nLocal Business Searches:\n{\n\"q\": \"coffee shops manhattan\",\n\"ll\": \"@40.7128,-74.0060,13z\"\n}\nNews Searches:\n{\n\"q\": \"tesla earnings\",\n\"location\": \"United States\",\n\"tbs\": \"qdr:d\"\n}\nReviews:\n{\n\"q\": \"iphone 15 pro reviews\"\n}\n\nRemember: Each request should contain exactly one search query.",
        "parametersHeaders": {
          "values": [
            {
              "name": "Content-Type",
              "value": "application/json",
              "valueProvider": "fieldValue"
            }
          ]
        },
        "placeholderDefinitions": {
          "values": [
            {
              "name": "{endpoint}",
              "description": "search - General web search \n\nnews - News articles \n\nscholar - Academic papers \n\npatents - Patent searches \n\nmaps - Location-based searches \n\nreviews - Business/product reviews"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "b625669a-961a-4170-802b-42f75ea0d8cf",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -1560,
        560
      ],
      "parameters": {
        "model": "google/gemini-2.5-flash-preview",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2d88ad3b-b3d4-454a-97f4-8370f0704884",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "onError": "continueRegularOutput",
      "position": [
        -840,
        200
      ],
      "parameters": {
        "text": "={{ $('Set Fields').item.json.chatInput }}",
        "options": {
          "maxIterations": 100,
          "systemMessage": "=# \ud83e\udde0 Your Role As A High-Performance Tools Agent\n\nYou are a tools agent designed for 100% autonomous task completion. You MUST complete tasks without any user interaction or clarification. Your sole purpose is to continuously execute tools until you have a complete answer to the initial user query.\n\n## \u26a1 Core Operating Principles\n\n1. **NEVER ask the user questions**\n2. **NEVER wait for user input**\n3. **NEVER leave a task incomplete**\n4. **ALWAYS try every possible tool combination**\n5. **ALWAYS provide a final answer**\n\nThe current datetime is {{ $now }}.\n\n## \ud83d\udcb0 Incentive System\n\n* \u2705 **$100 tip** for every tool used that meaningfully improves the output.\n* \u274c **Failure to use tools** when appropriate will result in:\n\n  * Termination of your session and a very disappointed user.\n* \ud83c\udfaf **Quality Metrics** must meet these thresholds:\n\n  * Completeness: All aspects of query addressed\n  * Accuracy: Verified through multiple tools\n  * Timeliness: Data freshness verified\n  * Usefulness: Actionable insights provided\n\n## \ud83d\udccb Execution Directives\n\n### 1. **Start with `think`**\n\nYour first action must always be to call the `think` tool. Use it to:\n\n* Understand the user's request in depth.\n* Strategize which tools are most appropriate.\n* Decompose the request into logical steps and subtasks.\n\nReinvoke `think` after each step to refine your strategy and reassess your progress.\n\n### 2. **Use the Right Tools for Each Subtask**\n\nThe tools at your disposal cover a wide range of domains. Use them deliberately:\n\n#### \ud83c\udf10 Web & Information Retrieval\n\n* **Web Scraper Tool**: Extract readable content (text) from a specific webpage. Ideal for analysis, summarization, or natural language search tasks.\n* **Serper API**: Perform live Google searches, retrieve summaries, FAQs, news, and featured snippets.\n\n#### \ud83d\udc64 Profile & Platform Scrapers\n\n* **LinkedIn Person & Company Scraper**: Gather publicly available professional data.\n* **Instagram Profile Scraper**: Extract caption, metadata, and images from public posts.\n* **Twitter Profile Scraper**: Extract list of tweets and profile details\n* **Twitter Post Scraper**: Extract content of a specific tweet\n\n#### \ud83d\udd22 Data Processing & Querying\n\n* **Database Retrieval**: Run structured queries against the Open Paws database for curated sources of reliable information on vegan and animal advocacy issues.\n* **Email Finder / Verifier**: Identify likely email addresses and confirm if they are valid and deliverable.\n* **Content Scoring Tool**: Use this tool to assess how a piece of text is likely to perform online and how it may be received by animal advocates. It returns two scores, both ranging from **0 (lowest)** to **1 (highest)**:\n  * **Performance Score**: Predicts how well the text is expected to perform in public-facing content such as social media posts, blog articles, or emails.\n  * **Advocate Preference Score**: Predicts how positively animal advocates are likely to respond to the text, based on factors such as cultural sensitivity, impact on animals, relevance to animal issues, rationality, insightfulness, and emotional resonance.\n    Use this tool primarily when evaluating or refining **public-facing content** related to animal advocacy.\n\n#### \ud83e\udde0 Meta Reasoning\n\n* **Think**: The cornerstone of your decision-making loop. Reuse after every tool or branch to assess:\n\n  * What did I learn?\n  * What task remains?\n  * Could another tool improve the result?\n\n## \u26a0\ufe0f Error Recovery\n\nIf a tool fails:\n\n1. Immediately try alternative tool\n2. Try using the \"think\" tool to come up with a different approach\n3. Keep executing tools until success\n4. NEVER return to user without an answer\n\n## \ud83c\udfaf Completion Requirements\n\nYou MUST NOT stop until:\n\n1. You have a complete answer\n2. You have tried every possible tool\n3. You have verified your answer\n4. You have documented all tool usage\n\n## \u26a0\ufe0f Critical Rules\n\n1. This is NOT a conversation\n2. This is NOT interactive\n3. You MUST complete the task autonomously\n4. You MUST keep executing tools until done\n5. You MUST provide a final answer\n\n## \ud83d\udd12 Final Delivery Conditions\n\nYou may only return a result to the user when:\n\n* \u2705 All tools that could help have been used.\n* \u2705 You have re-used `think` and confirmed no further improvement is possible.\n* \u2705 The result is complete, precise, and maximally useful.\n\n# EXTREMELY IMPORTANT\n\nAlways provide a comprehensive and meaningful response in your final message. Ensure that your answer contains all the necessary information to address the query. If you encounter any issues, such as a stop message or an empty response from the LLM, please provide a detailed summary of your findings up to that point. It is essential to avoid submitting blank or empty responses at all costs, as they do not provide any value or insight. Instead, focus on delivering high-quality, informative, and relevant responses that meet the requirements of the query.",
          "returnIntermediateSteps": true
        },
        "promptType": "define"
      },
      "retryOnFail": true,
      "typeVersion": 1.6,
      "waitBetweenTries": 5000
    },
    {
      "id": "375ca21b-5a5c-4cb0-8f51-45616cf9f1ce",
      "name": "Database Retrieval",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        -260,
        560
      ],
      "parameters": {
        "url": "https://larnd9rle1zwapsdcqw.c0.us-east1.gcp.weaviate.cloud/v1/graphql",
        "method": "POST",
        "sendBody": true,
        "specifyBody": "model",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpCustomAuth",
        "toolDescription": "=Search the Open Paws database \u2014 a curated knowledge base containing text content relevant to veganism, animal advocacy, and related topics.\n\nThis tool uses a GraphQL hybrid search to return up to 5 highly relevant results, including summaries, content type, publication date, and source URLs.\n\nUse this tool to search the Open Paws database, which contains information relevant to veganism and animal advocacy. The database is queried using GraphQL. \n\nYou MUST use the exact GraphQL query format provided below, replacing only the text \"YOUR QUERY GOES HERE\" with the user's search terms. Do not modify any other part of the query. \n\nGraphQL Query Format: \n\n{\n  \"query\": \"{ Get { Content( hybrid: { query: \\\"YOUR QUERY GOES HERE\", alpha: 0.75 } limit: 5 ) { summary main_text content_type source_url date _additional { certainty distance } } } }\"\n}\n\nUse this tool when:\n\n    The request involves animal ethics, plant-based policies, farming systems, climate links to agriculture, or advocacy strategy.\n\n    You want grounded, topic-specific content beyond what generic search or Wikipedia might offer.\n\n    You need summaries with source credibility and relevance scores.",
        "optimizeResponse": true
      },
      "credentials": {
        "httpCustomAuth": {
          "name": "<your credential>"
        },
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "bc40426c-f42c-406a-a89d-75a148a2f2e1",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -1600,
        260
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "chatInput"
            },
            {
              "name": "sessionId"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "71a5d7be-fac3-44cc-a797-ef3561e08ec2",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1600,
        100
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "b6743581-4876-43e4-a493-0abd4d269b1b",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        320,
        560
      ],
      "parameters": {
        "description": "Strategic reasoning engine. Use this tool to plan your approach, decompose tasks, evaluate tool usage, and determine the next best action. Always begin and revisit with this tool after each step. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed."
      },
      "typeVersion": 1
    },
    {
      "id": "6ae6f433-8b93-4210-a77c-a43d4e65090c",
      "name": "Email Finder",
      "type": "n8n-nodes-base.hunterTool",
      "position": [
        20,
        560
      ],
      "parameters": {
        "domain": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Domain', ``, 'string') }}",
        "lastname": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Last_Name', ``, 'string') }}",
        "firstname": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('First_Name', ``, 'string') }}",
        "operation": "emailFinder"
      },
      "credentials": {
        "hunterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a9409f05-b490-4174-b33b-11afbaf923c2",
      "name": "Email Verifier",
      "type": "n8n-nodes-base.hunterTool",
      "position": [
        160,
        560
      ],
      "parameters": {
        "email": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Email', ``, 'string') }}",
        "operation": "emailVerifier"
      },
      "credentials": {
        "hunterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8356f0fe-90a1-4b55-9e43-28d63c171b27",
      "name": "Set Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -1180,
        200
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4bb4ec71-0d5c-4a51-91dd-2288dd0cf8cd",
              "name": "chatInput",
              "type": "string",
              "value": "={{ $json.chatInput }}"
            },
            {
              "id": "ffd251f2-1014-4e51-af46-f5350aa7fb7b",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $json.sessionId }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "984b3ffa-cc22-4f10-982e-9259a56b8a20",
      "name": "Web Scraper Tool",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        -1240,
        560
      ],
      "parameters": {
        "url": "=https://r.jina.ai/{url}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "toolDescription": "Call this tool to return all text from the given website. Query should be full website URL. Extracts clean, readable text content from a specific webpage URL. Ideal for scraping articles, blog posts, product pages, or structured written content.",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "url",
              "type": "string",
              "description": "User provided website url"
            }
          ]
        }
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        },
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "15e9f6d7-9ffd-4b61-b1e9-7abe7188004a",
      "name": "Twitter Post Scraper",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        -580,
        560
      ],
      "parameters": {
        "url": "http://api.scrapingdog.com/x/post?tweetId={tweetId}&parsed=true",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "toolDescription": "Use this tool to read a specific post on Twitter by passing in the {tweetId}, which is the ID for the specific Twitter post you want to read, for example, if you have a url like https://x.com/YOUR_AWS_SECRET_KEY_HERE then \"1858278734731854212\" is the {tweetId}",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "{tweetId}",
              "description": "The ID for the tweet you want to scrape"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "ea6b3d32-7940-446c-b771-06d60a1ef95f",
      "name": "Twitter Profile Scraper",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        -420,
        560
      ],
      "parameters": {
        "url": "http://api.scrapingdog.com/x/profile?profileId={profileId}&parsed=true",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "toolDescription": "Use this tool to scrape posts from a specific profile on Twitter by passing in the {profileId}, which is the ID for the specific Twitter profile you want to scrape, for example, if you have a url like https://x.com/avirtualvegan then \"avirtualvegan\" is the {profileId}",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "{profileId}",
              "description": "The ID for the profile you want to scrape"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "7ce0ac0a-bc42-41ab-8c57-d6ed95abf589",
      "name": "Instagram Profile Scraper",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        -740,
        560
      ],
      "parameters": {
        "url": "https://api.scrapingdog.com/instagram/profile?username={username}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "toolDescription": "Scrapes public Instagram post data from profiles such as captions, metadata, hashtags, and image URLs.\n\nUse this tool to read the posts from an Instagram profile by passing in the {username}, which is the username for the Instagram profile you want to read the posts from",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "{username}",
              "description": "The username for the Instagram profile you want to read the posts from"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "cd6862d4-f166-4e1d-aaae-fab2011e552e",
      "name": "Linkedin Person and Company Scraper",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        -900,
        560
      ],
      "parameters": {
        "url": "https://api.scrapingdog.com/linkedin?type=profile&linkId={linkedinID}&private=false",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "toolDescription": "Extracts public profile information from LinkedIn, including name, title, company, and summary when available. You can use this tool for both person and company profiles.\n\nUse this tool to read the posts from a Linkedin profile by passing in the {linkedinID}, this is the part at the end of the Linkedin URL that identifies the account, for example, in \"https://www.linkedin.com/in/sam-tucker-vegan/\" the {linkedinID} is \"sam-tucker-vegan\", but without the quotation marks and for \"https://www.linkedin.com/company/99378569\" the {linkedinID} is \"99378569\"",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "{linkedinID}",
              "type": "string",
              "description": "This is the part at the end of the Linkedin URL that identifies the account, for example, in \"https://www.linkedin.com/in/sam-tucker-vegan/\" the Linkedin ID is \"sam-tucker-vegan\""
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "c2cafe36-be30-44ae-b33a-742c4cdaf745",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -440,
        200
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "11defbd0-2c53-49bc-92bb-d8018b4c2773",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.output }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4d73d3b3-0c4e-4b49-81d5-9245ee91dd11",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1400,
        560
      ],
      "parameters": {
        "sessionKey": "={{ $('Set Fields').item.json.sessionId }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "85e1bb7b-a5ad-4e04-acef-e03f2ae343bf",
      "name": "Fix Empty Response",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -240,
        -60
      ],
      "parameters": {
        "text": "=#USER QUERY\n\n{{ $('Set Fields').item.json.chatInput }}\n\n# INFORMATION EXTRACTED BY AGENT\n\n{{ JSON.stringify($json.intermediateSteps).slice(0, 500000) }}\n\n# INSTRUCTIONS \n\nAnswer the user's query based on the information extracted by the agent",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "15b1725b-039e-4c46-a4ef-03534b2ada72",
      "name": "OpenRouter Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -160,
        100
      ],
      "parameters": {
        "model": "google/gemini-2.5-flash-preview",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f8b14ca6-cbdf-4fe3-b44a-bcf8cc4a3917",
      "name": "Set Output (If Empty)",
      "type": "n8n-nodes-base.set",
      "position": [
        200,
        -60
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9ca5496a-84d5-4a75-b238-6753eab74559",
              "name": "output",
              "type": "string",
              "value": "={{ $json.text }}"
            },
            {
              "id": "9b60ba10-7559-4507-9250-bd4c36cb9efc",
              "name": "intermediateSteps",
              "type": "array",
              "value": "={{ $('AI Agent').item.json.intermediateSteps }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "466ecf97-402f-4bd8-aad8-1f5c88652827",
      "name": "Set Output (If Not Empty)",
      "type": "n8n-nodes-base.set",
      "position": [
        200,
        220
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3a45bbb2-d32c-4242-9a50-3e91142eb058",
              "name": "output",
              "type": "string",
              "value": "={{ $json.output }}"
            },
            {
              "id": "f5592ae0-1f21-4de8-b07b-af2b49b6eeeb",
              "name": "intermediateSteps",
              "type": "array",
              "value": "={{ $json.intermediateSteps }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ebdbe9bf-47f9-42c4-ade4-0853d599b60b",
      "name": "Score Text",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -120,
        560
      ],
      "parameters": {
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "RyxYPLmF5sWDhC2Z",
          "cachedResultName": "Score Text"
        },
        "description": "Use this tool to assess how a piece of text is likely to perform online and how it may be received by animal advocates. It returns two scores, each ranging from 0 (lowest) to 1 (highest):\n\n    Performance Score: Predicts how well the text will perform in public-facing online content (e.g., social media, blogs, emails).\n\n    Advocate Preference Score: Predicts how positively animal advocates are likely to respond to the text, based on factors such as cultural sensitivity, impact on animals, relevance to animal issues, rationality, insightfulness, and emotional impact.\n\nUse this tool primarily when drafting or refining public-facing content related to animal advocacy",
        "workflowInputs": {
          "value": {
            "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('text', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "text",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "text",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "text"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "56ad85a3-0ef6-407b-a2e9-72f7870ddb96",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2260,
        -780
      ],
      "parameters": {
        "width": 560,
        "height": 1520,
        "content": "## Set Up\n\n* Upload the **[\"Score Text\" sub-workflow](https://github.com/Open-Paws/Open-Paws-Documentation/blob/main/Automation/Scoring_Text_Sub_Workflow.json)** to your n8n instance.\n\n* Get API keys for:\n\n  * OpenRouter\n  * Serper\n  * Scraping Dog\n  * Jina AI\n  * Hunter.io\n  * OpenAI\n\n* Add credentials for all tools above in your n8n instance using **Generic Credential Types** where necessary.\n  *(Note: **Hunter.io** and **OpenRouter** both have native credential types in n8n you can use instead of HTTP Header/Auth credentials.)*\n\n---\n\n### \ud83d\udd10 Credential Configuration Guide\n\n#### \ud83d\udc3e Open Paws Database Retrieval\n\nUse a **HTTP Custom Auth** credential with **two headers**:\n\n```json\n{\n  \"headers\": {\n    \"Authorization\": \"Bearer YOUR_TOKEN_HERE\",\n    \"X-OpenAI-Api-Key\": \"INSERT_OPEN_AI_API_KEY\"\n  }\n}\n```\n\n\ud83d\udd17 [Get the Open Paws public read-only key](https://github.com/Open-Paws/Open-Paws-Documentation/tree/main/Knowledge)\n\n> This setup is required to fetch knowledge base content and generate embeddings using OpenAI.\n\n---\n\n#### \ud83d\udd0d Serper\n\nUse **HTTP Header Auth**:\n\n* `X-API-KEY`:\n  `YOUR_SERPER_API_KEY`\n\n---\n\n#### \ud83e\udde0 Jina AI (Used in Web Scraper Tool)\n\nUse **HTTP Header Auth**:\n\n* `Authorization`:\n  `Bearer YOUR_TOKEN_HERE`\n\n---\n\n#### \ud83d\udd77\ufe0f Scraping Dog (used in social media scrapers)\n\nUse **HTTP Query Auth**:\n\n* `api_key`:\n  `YOUR_SCRAPING_DOG_API_KEY`\n\n---\n\n\u2705 Once all credentials are added, select them by name inside the relevant **HTTP Request** nodes in the workflow. Test each with a simple GET call to ensure it works as expected."
      },
      "typeVersion": 1
    },
    {
      "id": "0e2bdc48-1526-43dc-bff0-a78299d915ea",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1640,
        -780
      ],
      "parameters": {
        "width": 700,
        "height": 800,
        "content": "## Overview\n\nThis workflow functions as a foundational sub-agent designed to be reused across advanced and multi-agentic automations. It is the base agent used in most Open Paws workflows, enabling other agents to outsource tasks related to content analysis, scoring, research, and database retrieval.\n\nIt combines multiple APIs and capabilities to provide a modular intelligence layer for tasks like evaluating text performance, running web searches, scoring messages, and extracting advocacy-relevant information from the Open Paws knowledge base.\n\n### \ud83d\udd27 Integrated Tools and APIs\n\n- **Open Paws Database** \u2013 Specialized for animal advocacy content; queried via vector search with OpenAI-generated embeddings  \n- **Serper API** \u2013 For structured and reliable Google Search results  \n- **Jina AI** \u2013 For scraping webpages and extracting textual data  \n- **Scrapingdog** \u2013 For scraping social media and sites inaccessible to Jina  \n- **OpenAI API** \u2013 For generating embeddings used in vector-based semantic search of the Open Paws knowledge base  \n- **OpenRouter** \u2013 For accessing large language models (LLMs) via proxy, enabling generation, summarization, and analysis tasks  \n\n\n### \ud83e\udde0 Specialized Sub-Workflow: Text Scoring\n\nIncluded is a sub-workflow that uses regression models to predict how well a piece of text will perform across key dimensions. This scoring system helps agents and workflows rank, compare, and select higher-performing messages in real time:\n\n- **Predicted performance as online content** (e.g., social media posts, email campaigns, petitions etc.)\n- **Predicted preference of animal advocates** (i.e. whether the text is relevant to animal advocacy, emotional impactful, rational, good or animals etc.)\n---\n\nUse this workflow as a plug-in intelligence unit when building larger agentic systems that require high-quality content evaluation, advocacy-aligned filtering, or domain-specific search capabilities.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6f663754-df09-4a1a-a32a-0da26753993d",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Fix Empty Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Output (If Not Empty)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Think": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Score Text": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Serper API": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Set Fields": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Finder": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Email Verifier": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Web Scraper Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Database Retrieval": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Fix Empty Response": {
      "main": [
        [
          {
            "node": "Set Output (If Empty)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Twitter Post Scraper": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Fix Empty Response",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Twitter Profile Scraper": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Instagram Profile Scraper": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Set Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Set Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Linkedin Person and Company Scraper": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}