AutomationFlowsAI & RAG › Sistema Automação Jurídica - Workflow Principal

Sistema Automação Jurídica - Workflow Principal

Sistema Automação Jurídica - Workflow Principal. Uses googleDrive, httpRequest, googleDocs, googleSheets. Webhook trigger; 11 nodes.

Webhook trigger★★★★☆ complexity11 nodesGoogle DriveHTTP RequestGoogle DocsGoogle SheetsEmail Send
AI & RAG Trigger: Webhook Nodes: 11 Complexity: ★★★★☆ Added:

This workflow follows the Emailsend → Google Drive recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Sistema Automa\u00e7\u00e3o Jur\u00eddica - Workflow Principal",
  "nodes": [
    {
      "parameters": {},
      "id": "node-1",
      "name": "Webhook - Receber PDF",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "path": "={{$json[\"attachments\"][0][\"url\"]}}"
      },
      "id": "node-2",
      "name": "Google Drive - Buscar PDF",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "http://python-services:5000/extract-pdf",
        "options": {
          "bodyContentType": "json"
        },
        "jsonParameters": true,
        "bodyParametersJson": "={{$json}}"
      },
      "id": "node-3",
      "name": "Python - Extrair Texto PDF",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "http://python-services:5000/firac-analysis",
        "options": {
          "bodyContentType": "json"
        },
        "jsonParameters": true,
        "bodyParametersJson": "={{$json}}"
      },
      "id": "node-4",
      "name": "An\u00e1lise FIRAC",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        900,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json[\"analysis_type\"]}}",
              "operation": "equal",
              "value2": "jurisprudence"
            }
          ]
        }
      },
      "id": "node-5",
      "name": "Switch - Tipo de An\u00e1lise",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 1,
      "position": [
        1120,
        300
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "http://python-services:5000/datajud-search",
        "options": {
          "bodyContentType": "json"
        },
        "jsonParameters": true,
        "bodyParametersJson": "={{$json}}"
      },
      "id": "node-6",
      "name": "DATAJUD - Pesquisa Jurisprud\u00eancia",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        1340,
        200
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "http://python-services:5000/distinguish-analysis",
        "options": {
          "bodyContentType": "json"
        },
        "jsonParameters": true,
        "bodyParametersJson": "={{$json}}"
      },
      "id": "node-7",
      "name": "An\u00e1lise Distinguish",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        1560,
        200
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "http://python-services:5000/generate-document",
        "options": {
          "bodyContentType": "json"
        },
        "jsonParameters": true,
        "bodyParametersJson": "={\"document_type\": \"sentenca\", \"case_data\": $json}"
      },
      "id": "node-8",
      "name": "OpenAI - Gerar Minuta",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        1780,
        300
      ]
    },
    {
      "parameters": {
        "resource": "document",
        "operation": "create",
        "title": "Minuta - {{$json[\"case_number\"]}}"
      },
      "id": "node-9",
      "name": "Google Docs - Salvar Minuta",
      "type": "n8n-nodes-base.googleDocs",
      "typeVersion": 1,
      "position": [
        2000,
        300
      ]
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": "YOUR_SHEET_ID",
        "sheetName": "Processos",
        "columnMappings": {
          "processo": "={{$json[\"case_number\"]}}",
          "data": "={{$now}}",
          "status": "={{$json[\"status\"]}}",
          "minuta_link": "={{$json[\"document_url\"]}}"
        }
      },
      "id": "node-10",
      "name": "Google Sheets - Registrar",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        2220,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "sistema@seudominio.com",
        "toEmail": "={{$json[\"user_email\"]}}",
        "subject": "An\u00e1lise Processual Conclu\u00edda - {{$json[\"case_number\"]}}",
        "message": "A an\u00e1lise do processo foi conclu\u00edda com sucesso. Documento dispon\u00edvel em: {{$json[\"document_url\"]}}"
      },
      "id": "node-11",
      "name": "Email - Notifica\u00e7\u00e3o",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "position": [
        2440,
        300
      ]
    }
  ],
  "connections": {
    "Webhook - Receber PDF": {
      "main": [
        [
          {
            "node": "Google Drive - Buscar PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive - Buscar PDF": {
      "main": [
        [
          {
            "node": "Python - Extrair Texto PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Python - Extrair Texto PDF": {
      "main": [
        [
          {
            "node": "An\u00e1lise FIRAC",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "An\u00e1lise FIRAC": {
      "main": [
        [
          {
            "node": "Switch - Tipo de An\u00e1lise",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch - Tipo de An\u00e1lise": {
      "main": [
        [
          {
            "node": "DATAJUD - Pesquisa Jurisprud\u00eancia",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DATAJUD - Pesquisa Jurisprud\u00eancia": {
      "main": [
        [
          {
            "node": "An\u00e1lise Distinguish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "An\u00e1lise Distinguish": {
      "main": [
        [
          {
            "node": "OpenAI - Gerar Minuta",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI - Gerar Minuta": {
      "main": [
        [
          {
            "node": "Google Docs - Salvar Minuta",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Docs - Salvar Minuta": {
      "main": [
        [
          {
            "node": "Google Sheets - Registrar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets - Registrar": {
      "main": [
        [
          {
            "node": "Email - Notifica\u00e7\u00e3o",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "saveManualExecutions": true,
    "saveDataSuccessExecution": "all",
    "saveDataErrorExecution": "all",
    "saveDataProgressExecution": true
  },
  "staticData": {},
  "tags": [
    "legal",
    "automation",
    "judiciary"
  ],
  "triggerCount": 1,
  "updatedAt": "2025-06-30T11:54:45.441Z",
  "versionId": "1"
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Sistema Automação Jurídica - Workflow Principal. Uses googleDrive, httpRequest, googleDocs, googleSheets. Webhook trigger; 11 nodes.

Source: https://github.com/fbmoulin/2acivelagent/blob/98ca5b0d12321ed870e74b6f87a615d52ecf6edb/main-workflow-n8n.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Automatically transforms your travel photos and notes into beautiful journals, highlight reels, and review drafts using Claude's vision and language capabilities. Trip Completion Trigger - Webhook or

HTTP Request, Google Sheets, Agent +3
AI & RAG

This workflow automates pre-dispatch customs document validation for international shipments. It ingests shipping document packages, extracts content from each file, uses Claude AI to cross-validate a

Google Drive Trigger, Google Drive, Agent +4
AI & RAG

This workflow ingests property document packages submitted via webhook or monitored cloud storage, extracts text from each file, runs Claude AI to verify legal compliance, detect missing or expired do

Google Drive Trigger, Google Drive, Agent +4
AI & RAG

L&D_AgentsAI_ATIVO. Uses httpRequest, agent, googleCalendarTool, toolSerpApi. Webhook trigger; 93 nodes.

HTTP Request, Agent, Google Calendar Tool +9
AI & RAG

ANIS_HUB 1. Uses gmail, googleDrive, googleSheets, httpRequest. Webhook trigger; 89 nodes.

Gmail, Google Drive, Google Sheets +3