AutomationFlowsSlack & Telegram › Prompt Engine 2.0 Workflow

Prompt Engine 2.0 Workflow

Prompt Engine 2.0 Workflow. Uses readBinaryFile, httpRequest, googleSheets, slack. Webhook trigger; 12 nodes.

Webhook trigger★★★★☆ complexity12 nodesRead Binary FileHTTP RequestGoogle SheetsSlack
Slack & Telegram Trigger: Webhook Nodes: 12 Complexity: ★★★★☆ Added:

This workflow follows the Google Sheets → HTTP Request 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": "Prompt Engine 2.0 Workflow",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "generate-prompt",
        "options": {}
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "query",
              "value": "={{ $json.body.query }}"
            },
            {
              "name": "style",
              "value": "={{ $json.body.style || 'Silicon Valley' }}"
            },
            {
              "name": "modelTarget",
              "value": "={{ $json.body.modelTarget || 'Claude' }}"
            },
            {
              "name": "version",
              "value": "={{ $json.body.version || 'full' }}"
            }
          ]
        },
        "options": {}
      },
      "name": "Extract Parameters",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.query }}",
              "operation": "isNotEmpty"
            }
          ]
        }
      },
      "name": "Validate Input",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "filePath": "=/root/prompt-engine-2.0/system-message{{ $json.version === 'short' ? '-short' : $json.version === 'minimal' ? '-minimal' : '' }}.txt"
      },
      "name": "Load System Message",
      "type": "n8n-nodes-base.readBinaryFile",
      "typeVersion": 1,
      "position": [
        850,
        200
      ]
    },
    {
      "parameters": {
        "content": "={{ $json.data.toString('utf8') }}",
        "options": {}
      },
      "name": "Convert to Text",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1050,
        200
      ]
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "url": "https://api.anthropic.com/v1/messages",
        "options": {
          "headers": {
            "entries": [
              {
                "name": "anthropic-version",
                "value": "2023-06-01"
              }
            ]
          }
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"model\": \"claude-3-5-sonnet-latest\",\n  \"max_tokens\": 4000,\n  \"temperature\": 0.2,\n  \"system\": \"{{ $node['Convert to Text'].json.content }}\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": \"{{ $node['Extract Parameters'].json.query }}\\n\\nParameters:\\n- Style: {{ $node['Extract Parameters'].json.style }}\\n- Target model: {{ $node['Extract Parameters'].json.modelTarget }}\\n- Output: 2 variants + comparison + recommendations\\n- Reasoning: provide brief bullet reasoning\"\n    }\n  ]\n}"
      },
      "name": "Call Anthropic API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        1250,
        200
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "generatedPrompt",
              "value": "={{ $json.content[0].text }}"
            },
            {
              "name": "model",
              "value": "={{ $json.model }}"
            },
            {
              "name": "tokensInput",
              "value": "={{ $json.usage.input_tokens }}"
            },
            {
              "name": "tokensOutput",
              "value": "={{ $json.usage.output_tokens }}"
            },
            {
              "name": "stopReason",
              "value": "={{ $json.stop_reason }}"
            }
          ]
        },
        "options": {}
      },
      "name": "Format Response",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1450,
        200
      ]
    },
    {
      "parameters": {
        "content": "={\n  \"success\": true,\n  \"data\": {\n    \"prompt\": {{ $json.generatedPrompt }},\n    \"metadata\": {\n      \"model\": {{ $json.model }},\n      \"tokens\": {\n        \"input\": {{ $json.tokensInput }},\n        \"output\": {{ $json.tokensOutput }}\n      },\n      \"stopReason\": {{ $json.stopReason }}\n    }\n  }\n}",
        "options": {}
      },
      "name": "Success Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        1650,
        200
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\n  \"success\": false,\n  \"error\": \"Invalid request\",\n  \"message\": \"Query parameter is required\"\n}",
        "options": {
          "responseCode": 400
        }
      },
      "name": "Error - Missing Query",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        850,
        400
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\n  \"success\": false,\n  \"error\": \"API Error\",\n  \"message\": \"{{ $json.message || 'Failed to generate prompt' }}\",\n  \"details\": \"{{ $json.description }}\"\n}",
        "options": {
          "responseCode": 500
        }
      },
      "name": "Error - API Failure",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        1450,
        400
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "fileId": {
          "__rl": true,
          "value": "your-google-sheet-id",
          "mode": "id"
        },
        "values": {
          "value": "={{ [\n  {\n    timestamp: new Date().toISOString(),\n    query: $node['Extract Parameters'].json.query,\n    style: $node['Extract Parameters'].json.style,\n    modelTarget: $node['Extract Parameters'].json.modelTarget,\n    tokensInput: $json.tokensInput,\n    tokensOutput: $json.tokensOutput,\n    model: $json.model\n  }\n] }}"
        },
        "options": {}
      },
      "name": "Log to Google Sheets (Optional)",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        1650,
        350
      ],
      "disabled": true,
      "notes": "Enable this node to log all requests to Google Sheets for analytics"
    },
    {
      "parameters": {
        "operation": "sendMessage",
        "chatId": "your-slack-channel-id",
        "text": "=New Prompt Generated!\n\nQuery: {{ $node['Extract Parameters'].json.query }}\nStyle: {{ $node['Extract Parameters'].json.style }}\nTokens: {{ $json.tokensOutput }}\n\nPrompt preview:\n{{ $json.generatedPrompt.substring(0, 200) }}...",
        "otherOptions": {}
      },
      "name": "Notify Slack (Optional)",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.1,
      "position": [
        1650,
        500
      ],
      "disabled": true,
      "notes": "Enable this node to get Slack notifications for each generation"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Extract Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Parameters": {
      "main": [
        [
          {
            "node": "Validate Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Input": {
      "main": [
        [
          {
            "node": "Load System Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error - Missing Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load System Message": {
      "main": [
        [
          {
            "node": "Convert to Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to Text": {
      "main": [
        [
          {
            "node": "Call Anthropic API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Anthropic API": {
      "main": [
        [
          {
            "node": "Format Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error - API Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Response": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log to Google Sheets (Optional)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify Slack (Optional)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    {
      "name": "Prompt Engine",
      "id": "1"
    },
    {
      "name": "AI",
      "id": "2"
    }
  ],
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "versionId": "1.0.0"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

Prompt Engine 2.0 Workflow. Uses readBinaryFile, httpRequest, googleSheets, slack. Webhook trigger; 12 nodes.

Source: https://github.com/gacabartosz/prompt-engine-2.0/blob/87e635b84586880d5edf005492fb6977ee8be876/examples/n8n/prompt-engine-workflow.json — original creator credit. Request a take-down →

More Slack & Telegram workflows → · Browse all categories →

Related workflows

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

Slack & Telegram

This workflow is a complete, production-ready solution for recovering abandoned carts in Shopify stores using a multi-channel, multi-touch approach. It automates personalized follow-ups via Email, SMS

HTTP Request, Shopify, SendGrid +5
Slack & Telegram

Turn every sales meeting into a coaching opportunity. This workflow automatically analyzes tldv meeting recordings using OpenAI (GPT-4) to provide instant, actionable feedback to your sales team.

HTTP Request, Slack, Google Sheets
Slack & Telegram

Automated video processing system that monitors S3 for new uploads, generates thumbnails and preview clips, extracts metadata, transcodes to multiple formats, and distributes to CDN with webhook notif

HTTP Request, Google Sheets, Slack
Slack & Telegram

Eliminate manual data entry from your accounts payable process. This workflow transforms raw invoice scans into structured financial records by combining UploadToURL for hosting, AWS Textract for OCR

N8N Nodes Uploadtourl, HTTP Request, Google Sheets +1
Slack & Telegram

Connect Fireflies and WayinVideo to this workflow once and every recorded sales call automatically generates a set of training clips delivered to your Slack channel. The moment Fireflies finishes tran

HTTP Request, Google Sheets, Slack