AutomationFlowsAI & RAG › AI Contract Example

AI Contract Example

AI contract example. Uses agent, lmChatOpenAi, outputParserStructured. Event-driven trigger; 4 nodes.

Event trigger★★☆☆☆ complexityAI-powered4 nodesAgentOpenAI ChatOutput Parser Structured
AI & RAG Trigger: Event Nodes: 4 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the Agent → OpenAI Chat 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": "AI contract example",
  "nodes": [
    {
      "id": "trigger",
      "name": "Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "parameters": {}
    },
    {
      "id": "classify",
      "name": "Classify request",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3,
      "parameters": {
        "promptType": "define",
        "text": "=Classify this request: {{ $json.request }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "Return only the requested structured result."
        }
      }
    },
    {
      "id": "model",
      "name": "Chat model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "parameters": {
        "modelId": {
          "value": "gpt-example"
        },
        "options": {
          "temperature": 0
        }
      }
    },
    {
      "id": "parser",
      "name": "Result schema",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "parameters": {
        "schemaType": "fromJson",
        "jsonSchemaExample": "{\"category\":\"support\",\"urgent\":true}"
      }
    }
  ],
  "connections": {
    "Trigger": {
      "main": [
        [
          {
            "node": "Classify request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat model": {
      "ai_languageModel": [
        [
          {
            "node": "Classify request",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Result schema": {
      "ai_outputParser": [
        [
          {
            "node": "Classify request",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

AI contract example. Uses agent, lmChatOpenAi, outputParserStructured. Event-driven trigger; 4 nodes.

Source: https://github.com/syucream/s8n/blob/main/examples/ai-contract.workflow.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

Enrich Company Data from Google Sheet with OpenAI Agent and Scraper Tool. Uses outputParserStructured, lmChatOpenAi, googleSheets, toolWorkflow. Event-driven trigger; 13 nodes.

Output Parser Structured, OpenAI Chat, Google Sheets +4
AI & RAG

Sales Assistant Build. Uses manualTrigger, agent, lmChatOpenAi, toolHttpRequest. Event-driven trigger; 13 nodes.

Agent, OpenAI Chat, Tool Http Request +3
AI & RAG

A hands-on starter workflow that teaches beginners how to:

OpenAI Chat, Output Parser Structured, Google Sheets +1
AI & RAG

Bridge the gap between your development and project management workflows with this intelligent n8n template. This isn't just a simple sync; it uses an AI agent to analyze, classify, and intelligently

Github Trigger, Jira, Agent +3
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Form Trigger, OpenAI Chat, Memory Buffer Window +4