基于美国众议院法案使用Gemini AI生成周度动物权益行动简报
高级
这是一个Social Media, AI Summarization领域的自动化工作流,包含 26 个节点。主要使用 If, Set, Html, SplitOut, Aggregate 等节点。 基于美国众议院法案使用Gemini AI生成周度动物权益行动简报
前置要求
- •可能需要目标 API 的认证凭证
使用的节点 (26)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "7HFoSOJXuERT2aq8",
"meta": {
"instanceId": "26bd595441827fb23edb0643d6d240e79b0b8993d278e90950f16e18bf9e3c4a",
"templateCredsSetupCompleted": true
},
"name": "基于美国众议院法案生成周度动物权益行动简报",
"tags": [],
"nodes": [
{
"id": "b72df47f-b699-4306-815c-ae6b91dbfcff",
"name": "计划触发器",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-1080,
260
],
"parameters": {
"rule": {
"interval": [
{
"field": "weeks",
"triggerAtDay": [
1
],
"triggerAtHour": 8,
"triggerAtMinute": 1
}
]
}
},
"typeVersion": 1.2
},
{
"id": "0b576d38-7e6e-4ed7-a5b8-f4de30e5d1d4",
"name": "OpenRouter 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
-440,
440
],
"parameters": {
"model": "google/gemini-2.5-flash",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "QqgKARn52qQiKICN",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "26950285-21d7-414c-b34f-b6b616e657d7",
"name": "获取周度法案",
"type": "n8n-nodes-base.httpRequest",
"position": [
-900,
260
],
"parameters": {
"url": "https://docs.house.gov/floor/",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "97c8d5c1-eed1-4476-b9c2-1ee47e7192d0",
"name": "清理 PDF 链接",
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
"position": [
-500,
260
],
"parameters": {
"text": "={{ JSON.stringify($json.PDF) }}",
"options": {
"systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value.\n\nDo not include ```json, begin your response with the opening curly bracket, no backticks or code blocks"
},
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"PDF_Link\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"format\": \"uri\"\n }\n }\n },\n \"required\": [\"PDF_Link\"]\n}"
},
"typeVersion": 1.2
},
{
"id": "ea410519-8a6b-4ee5-8762-a06a1c350492",
"name": "分离链接",
"type": "n8n-nodes-base.splitOut",
"position": [
-180,
260
],
"parameters": {
"options": {},
"fieldToSplitOut": "output.PDF_Link"
},
"typeVersion": 1
},
{
"id": "3612f8ad-9d41-4cee-8838-7a7b897c7ef1",
"name": "下载 PDF",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
20,
260
],
"parameters": {
"url": "={{ $json['output.PDF_Link'] }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "9fe6840c-47ba-4345-86fb-1d9205d9af58",
"name": "将 PDF 转换为 Base64 字符串",
"type": "n8n-nodes-base.extractFromFile",
"position": [
240,
260
],
"parameters": {
"options": {},
"operation": "binaryToPropery"
},
"typeVersion": 1
},
{
"id": "5b6d7c0f-de88-43a7-b9ec-3c83e8a03ae6",
"name": "提取 PDF 链接",
"type": "n8n-nodes-base.html",
"position": [
-700,
260
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"extractionValues": {
"values": [
{
"key": "PDF",
"cssSelector": ".files",
"returnArray": true
}
]
}
},
"typeVersion": 1.2
},
{
"id": "0044749d-a0fc-4ba5-8183-b5b7aa048d0f",
"name": "无操作,不执行任何操作",
"type": "n8n-nodes-base.noOp",
"position": [
840,
520
],
"parameters": {},
"typeVersion": 1
},
{
"id": "ead98680-b763-4451-9c8f-ec30892776ea",
"name": "使用 Gemini 分析法案",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
440,
260
],
"parameters": {
"url": "=https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent",
"method": "POST",
"options": {
"batching": {
"batch": {
"batchSize": 1,
"batchInterval": 10000
}
}
},
"jsonBody": "={\n \"contents\": [{\n \"parts\": [\n {\n \"text\": \"Read and analyze the legislative bill in the attached PDF strictly from an animal rights and anti-exploitation perspective. Evaluate whether the bill directly or indirectly harms or benefits animals, including wildlife, farmed animals, aquatic animals, or habitats. Treat all forms of animal use, exploitation, or commodification (such as fisheries, hunting, or industrial farming) as harmful to animal welfare, even if presented as sustainable or economically beneficial. Return a JSON object that matches the response_json_schema.\"\n },\n {\n \"inline_data\": {\n \"mime_type\": \"application/pdf\",\n \"data\": \"{{ $json.data }}\"\n }\n }\n ]\n }],\n \"generationConfig\": {\n \"response_mime_type\": \"application/json\",\n \"response_json_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"bill_title\": { \n \"type\": \"string\", \n \"description\": \"Title or short identifier of the bill.\" \n },\n \"summary\": { \n \"type\": \"string\", \n \"description\": \"Plain-language summary of the bill with a critical animal rights analysis, highlighting any harm or benefits to animals or ecosystems.\" \n },\n \"animal_welfare_score\": { \n \"type\": \"number\", \n \"format\": \"float\", \n \"minimum\": 0, \n \"maximum\": 1, \n \"description\": \"0 = extremely harmful or exploitative toward animals, 1 = strongly protective of animal rights.\" \n },\n \"relevance_score\": { \n \"type\": \"number\", \n \"format\": \"float\", \n \"minimum\": 0, \n \"maximum\": 1, \n \"description\": \"0 = unrelated to animals, 1 = entirely about animal welfare or exploitation.\" \n },\n \"action_priority\": { \n \"type\": \"number\", \n \"format\": \"float\", \n \"minimum\": 0, \n \"maximum\": 1, \n \"description\": \"0 = no meaningful action needed, 1 = immediate and critical action required by activists.\" \n },\n \"stance\": { \n \"type\": \"string\", \n \"enum\": [\"support\", \"oppose\", \"monitor\"], \n \"description\": \"Recommended stance for animal activists (e.g., oppose if the bill promotes exploitation).\" \n },\n \"key_points_for_action\": { \n \"type\": \"array\", \n \"items\": { \"type\": \"string\" }, \n \"description\": \"Main points activists should emphasize in submissions or campaigns, highlighting animal rights concerns.\" \n }\n },\n \"required\": [\n \"bill_title\",\n \"summary\",\n \"animal_welfare_score\",\n \"relevance_score\",\n \"action_priority\",\n \"stance\",\n \"key_points_for_action\"\n ],\n \"propertyOrdering\": [\n \"bill_title\",\n \"summary\",\n \"animal_welfare_score\",\n \"relevance_score\",\n \"action_priority\",\n \"stance\",\n \"key_points_for_action\"\n ]\n }\n }\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth"
},
"credentials": {
"httpQueryAuth": {
"id": "ZWNf5Ktz3ifzH4bv",
"name": "Query Auth account"
}
},
"retryOnFail": true,
"typeVersion": 4.2,
"waitBetweenTries": 5000
},
{
"id": "66277c1e-5101-48ce-a118-7bb18015ecb9",
"name": "设置分析结果",
"type": "n8n-nodes-base.set",
"position": [
660,
260
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b2d4b1a2-163c-408c-beef-613d909e9cd1",
"name": "analysis",
"type": "object",
"value": "={{ $json.candidates[0].content.parts[0].text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "182e8856-adb1-4a30-8180-6a9a447e4f89",
"name": "检查是否需要响应",
"type": "n8n-nodes-base.if",
"position": [
840,
260
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "fbf1b7c1-e587-45ce-b113-1d6cd4d0c20b",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $json.analysis.relevance_score }}",
"rightValue": 0.5
},
{
"id": "cac67bfa-df05-4783-9cde-ddee3d7cacd1",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $json.analysis.action_priority }}",
"rightValue": 0.5
}
]
}
},
"typeVersion": 2.2
},
{
"id": "7d9229b7-7d66-4953-a667-d8a5b2067e5a",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1380,
240
],
"parameters": {
"width": 220,
"height": 180,
"content": "**周度调度器**"
},
"typeVersion": 1
},
{
"id": "9419d694-0822-45e2-b835-a9ff02417366",
"name": "聚合",
"type": "n8n-nodes-base.aggregate",
"position": [
1060,
260
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData"
},
"typeVersion": 1
},
{
"id": "957df544-850d-417f-b718-3ecd850f9984",
"name": "研究法案",
"type": "n8n-nodes-base.executeWorkflow",
"position": [
1240,
260
],
"parameters": {
"options": {},
"workflowId": {
"__rl": true,
"mode": "list",
"value": "k053fXGjIF7dUIQZ",
"cachedResultName": "♻️ 🧩 📚 General Research Agent"
},
"workflowInputs": {
"value": {
"chatInput": "=You are a research assistant specialized in US legislation and advocacy. Given the summary of the following legislative bill(s) related to animal welfare, dig deeper to uncover additional relevant information including:\n\n Names of bill sponsors and cosponsors, including their committee assignments and political affiliations\n\n Key lobbying groups or corporations supporting or opposing the bill, with details on their interests and past influence\n\n Advocacy organizations actively campaigning for or against the bill, including grassroots movements and national nonprofits\n\n Historical or related legislation context, such as previous versions of the bill, amendments, or connected policies\n\n Public sentiment indicators such as recent news headlines, editorials, social media trends, and relevant public statements by officials\n\n Contact information for relevant decision-makers, including committee chairs, bill sponsors, and influential legislators\n\n Key dates and upcoming milestones related to the bill’s progress (e.g., scheduled hearings, votes)\n\n Potential political or industry pressures that may impact the bill’s trajectory\n\n Data on related public petitions, endorsements, or opposition campaigns\n\n Relevant regulatory or agency actions tied to the bill’s subject matter\n\nProvide concise, actionable insights that activists can use to tailor their outreach and advocacy efforts effectively.\n\n# BILLS TO RESEARCH\n\n{{ JSON.stringify($json.data) }}",
"sessionId": "={{ (Math.random().toString(36).substring(2) + Date.now().toString(36)) }}"
},
"schema": [
{
"id": "chatInput",
"type": "string",
"display": true,
"required": false,
"displayName": "chatInput",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "sessionId",
"type": "string",
"display": true,
"required": false,
"displayName": "sessionId",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": true
}
},
"typeVersion": 1.2
},
{
"id": "6a9b6d0e-f202-44a6-badd-981f73eeb2a0",
"name": "OpenRouter 聊天模型1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
1440,
500
],
"parameters": {
"model": "anthropic/claude-sonnet-4",
"options": {}
},
"credentials": {
"openRouterApi": {
"id": "QqgKARn52qQiKICN",
"name": "OpenRouter account"
}
},
"typeVersion": 1
},
{
"id": "316e27e4-a73b-4590-825d-28df2ff6e0ad",
"name": "结构化输出解析器",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1580,
440
],
"parameters": {
"autoFix": true,
"jsonSchemaExample": "{\n\t\"subject_line\": \"email subject line goes here\",\n\t\"email_body_html\": \"html for email body goes here\"\n}"
},
"typeVersion": 1.3
},
{
"id": "d99b4e4a-6a1f-419d-b0e1-72641dd26f4e",
"name": "撰写邮件提醒",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
1460,
260
],
"parameters": {
"text": "=You are an expert email content writer creating a high‑impact, easy‑to‑scan HTML briefing for animal rights activists, covering **all relevant bills on the House floor this week**.\n\n**Your goal is to help activists win last‑minute legislative fights** by giving them exactly what they need to act quickly, persuasively, and effectively—without inventing any details not present in the data.\n\n### Requirements for the Email:\n\n1. **Subject line:**\n\n * Conveys overall urgency and key “ask” (e.g., “URGENT: Top 3 Animal Welfare Bills This Week – Take Action Now!”).\n\n2. **Top “Action Dashboard” (above the fold):**\n\n * **Ranked list of the top 3–5 bills** by `action_priority`.\n * For each bill, include:\n\n * **Bill title** (heading)\n * **Immediate “Ask”** (e.g., “Oppose H.R. 1917 by Tuesday EOD”)\n * **Visual urgency bar or badge**\n * **One‑sentence reason why it matters** (focused on animal rights)\n\n3. **Detailed Bill Sections (in priority order):**\n For **each bill**, include:\n\n * **Heading:** Bill title + urgency badge\n * **Recommended stance** (“Oppose,” “Support,” or “Monitor”)\n * **Concise summary** (2–3 sentences, animal‑rights focus, using only provided data)\n * **Key action points:**\n\n * Bullet list of what to say or do (based strictly on provided `weeklyBills` data)\n * Pre‑written **email/phone script snippets**\n * Suggested **social media text & hashtags**\n * **Contacts & Targets:**\n\n * Sponsor and committee chair (names and provided contact info)\n * Key swing votes (if available in data)\n * **Research intel highlights:**\n\n * Top lobbyists, counterarguments, advocacy coalitions (only if provided in data)\n * **Deadline & Next Steps:**\n\n * Date/time of vote or hearing\n * Clear “What to do by when” in bold\n\n4. **Resources & Tools:**\n\n * Links or templates (letters, petitions, graphics) **only if provided** in the data.\n * Clear follow‑up instructions (e.g., “Call again if no response”).\n\n5. **Closing Call to Action:**\n\n * Brief motivational note, e.g., “Your calls can make the difference on these votes this week.”\n * **No mentions of fictional campaign hubs or Slack groups** unless explicitly included in the data.\n\n**Format:**\nUse clean, well‑structured HTML. Headings, bold text, and color‑coded urgency badges must make the email scannable. Include clickable links if they are present in the data.\n\n---\n\n**CONTEXT/INPUT:**\n\n```\n{{ $json.output }}\n\n{{ JSON.stringify($('Aggregate').item.json.data) }}\n```",
"batching": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "65e737be-94e4-43f7-9a6b-cd3cec413695",
"name": "发送邮件",
"type": "n8n-nodes-base.emailSend",
"position": [
1820,
260
],
"webhookId": "07720c7f-e59e-436a-a4d5-a397256571f3",
"parameters": {
"html": "={{ $json.output.email_body_html }}",
"options": {
"appendAttribution": false
},
"subject": "={{ $json.output.subject_line }}",
"toEmail": "email@example.com",
"fromEmail": "email@example.com"
},
"credentials": {
"smtp": {
"id": "WT1fLClVHN3DUxyk",
"name": "info@openpaws.ai - ProtonMail SMTP"
}
},
"typeVersion": 2.1
},
{
"id": "de3110cd-e6e1-4b90-a3b5-f69bfcad8e2d",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-900,
0
],
"parameters": {
"width": 300,
"height": 220,
"content": "**法案获取与 PDF 解析**"
},
"typeVersion": 1
},
{
"id": "c2269de7-2e97-4a8e-8310-9219b01ac298",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
-280
],
"parameters": {
"width": 500,
"height": 500,
"content": "**AI 法案分析(Gemini)**"
},
"typeVersion": 1
},
{
"id": "b4916162-8909-4b63-9471-ebc5868e4484",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
780,
0
],
"parameters": {
"width": 200,
"height": 220,
"content": "**法案筛选**"
},
"typeVersion": 1
},
{
"id": "e6de7b01-6265-402c-9668-00f159f79408",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1460,
-40
],
"parameters": {
"height": 260,
"content": "**邮件撰写器**"
},
"typeVersion": 1
},
{
"id": "7639bf8b-26d8-4345-9f6e-eef3d79aaddd",
"name": "便利贴5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1760,
60
],
"parameters": {
"content": "**邮件发送**"
},
"typeVersion": 1
},
{
"id": "9ba1d4d1-6a4a-4523-886c-8efd7d422d88",
"name": "便签 6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1040,
-100
],
"parameters": {
"width": 340,
"height": 320,
"content": "**研究与情报收集**"
},
"typeVersion": 1
},
{
"id": "85596ffc-2713-41a4-8da9-1a2df989f00f",
"name": "便签 7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-500,
40
],
"parameters": {
"width": 620,
"height": 180,
"content": "**法案链接清理与 PDF 下载**"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "be9967ed-79ac-4bc8-972c-bd87486cf215",
"connections": {
"Aggregate": {
"main": [
[
{
"node": "Research Bills",
"type": "main",
"index": 0
}
]
]
},
"Download PDF": {
"main": [
[
{
"node": "Convert PDF to Base64 String",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Set Analysis": {
"main": [
[
{
"node": "Check If Response Needed",
"type": "main",
"index": 0
}
]
]
},
"Research Bills": {
"main": [
[
{
"node": "Write Email Alert",
"type": "main",
"index": 0
}
]
]
},
"Clean PDF Links": {
"main": [
[
{
"node": "Split Out Links",
"type": "main",
"index": 0
}
]
]
},
"Split Out Links": {
"main": [
[
{
"node": "Download PDF",
"type": "main",
"index": 0
}
]
]
},
"Get Weekly Bills": {
"main": [
[
{
"node": "Extract PDF Links",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Get Weekly Bills",
"type": "main",
"index": 0
}
]
]
},
"Extract PDF Links": {
"main": [
[
{
"node": "Clean PDF Links",
"type": "main",
"index": 0
}
]
]
},
"Write Email Alert": {
"main": [
[
{
"node": "Send email",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model": {
"ai_languageModel": [
[
{
"node": "Clean PDF Links",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model1": {
"ai_languageModel": [
[
{
"node": "Write Email Alert",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Structured Output Parser",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Analyze Bill with Gemini": {
"main": [
[
{
"node": "Set Analysis",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Check If Response Needed": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Write Email Alert",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Convert PDF to Base64 String": {
"main": [
[
{
"node": "Analyze Bill with Gemini",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 社交媒体, AI 摘要总结
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+93
113 节点I versus AI
其他
每周动物权益简报
使用Claude AI和Serper的自动化动物权益新闻研究与每周摘要
Set
Email Send
Execute Workflow
+4
11 节点Open Paws
社交媒体
每日 WhatsApp 群组智能分析:GPT-4.1 分析与语音消息转录
每日 WhatsApp 群组智能分析:GPT-4.1 分析与语音消息转录
If
Set
Code
+20
52 节点Daniel Lianes
杂项
灵活新闻聚合器 - 多源集成、AI分析和可设置频道
多源新闻策展系统,集成Mistral AI分析、摘要和自定义频道
If
Set
Xml
+32
120 节点Hybroht
内容创作
交付汉堡店MVP
🤖 餐厅与配送自动化的 AI 驱动 WhatsApp 助手
If
Set
Code
+37
152 节点Bruno Dias
社区问题监控器与OpenRouter AI、Reddit和论坛爬取
使用OpenRouter AI、Reddit和论坛爬取监控社区问题
Set
Code
Html
+13
29 节点Julian Kaiser
市场调研
工作流信息
难度等级
高级
节点数量26
分类2
节点类型16
作者
Open Paws
@openpawsOpen Paws is a nonprofit building open-source AI tools to accelerate animal advocacy. We create machine learning models and automation workflows trained on real-world campaign data to help end industrial animal exploitation. All tools are free, transparent, and designed for real-world impact.
外部链接
在 n8n.io 查看 →
分享此工作流