{"product_id":"claude-text-generator-webhook-with-slack-preview-n8n","title":"Claude Text Generator Webhook with Slack Preview (n8n)","description":"\u003ch3\u003eGenerate Claude text from an n8n webhook—then preview it in Slack\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow exposes a POST webhook that sends your \u003cstrong\u003euserPrompt\u003c\/strong\u003e to the \u003cstrong\u003eAnthropic Claude Messages API\u003c\/strong\u003e, returns a consistent JSON response with usage metadata, and automatically posts a short \u003cstrong\u003eSlack preview\u003c\/strong\u003e of the generated text via a \u003cstrong\u003eSlack Incoming Webhook\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives requests:\u003c\/strong\u003e Listens for a POST call on its webhook endpoint with a JSON body containing \u003ccode\u003euserPrompt\u003c\/code\u003e (and optional generation settings).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eValidates inputs:\u003c\/strong\u003e Checks that \u003ccode\u003euserPrompt\u003c\/code\u003e is present and applies defaults for \u003ccode\u003emodel\u003c\/code\u003e, \u003ccode\u003emaxTokens\u003c\/code\u003e, and \u003ccode\u003etemperature\u003c\/code\u003e. If validation fails, it returns a \u003cstrong\u003e400 JSON error\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCalls Claude with retries:\u003c\/strong\u003e Sends the prompt to \u003ccode\u003ehttps:\/\/api.anthropic.com\/v1\/messages\u003c\/code\u003e using the Anthropic Claude Messages API, with \u003cstrong\u003eautomatic retries\u003c\/strong\u003e for transient failures.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReturns consistent results:\u003c\/strong\u003e On success, extracts the generated text and responds with a \u003cstrong\u003e200 JSON payload\u003c\/strong\u003e that includes the generated output plus \u003cstrong\u003eusage metadata\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePosts to Slack:\u003c\/strong\u003e After a successful Claude call, publishes a short preview of the generated text to Slack using an \u003cstrong\u003eIncoming Webhook\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eError handling:\u003c\/strong\u003e If Claude fails after retries, it returns a structured \u003cstrong\u003e502 JSON error\u003c\/strong\u003e to the webhook caller.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSaaS backends\u003c\/strong\u003e that need on-demand Claude text generation triggered by API calls.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAutomation engineers\u003c\/strong\u003e building reliable AI endpoints with validation, retry logic, and clear error responses.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTeams\u003c\/strong\u003e who want human-readable visibility through a quick \u003cstrong\u003eSlack preview\u003c\/strong\u003e of what Claude generated.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes\/workflow logic:\u003c\/strong\u003e \u003ccode\u003ewebhook\u003c\/code\u003e, \u003ccode\u003eif\u003c\/code\u003e, \u003ccode\u003eset\u003c\/code\u003e, \u003ccode\u003ecode\u003c\/code\u003e, \u003ccode\u003ehttp request\u003c\/code\u003e, plus workflow notes (sticky note).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations:\u003c\/strong\u003e \u003cstrong\u003eAnthropic Claude Messages API\u003c\/strong\u003e (HTTP request to \u003ccode\u003e\/v1\/messages\u003c\/code\u003e) and \u003cstrong\u003eSlack Incoming Webhook\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSetup:\u003c\/strong\u003e Configure an Anthropic API credential in n8n, paste your Slack webhook URL into the workflow, and send POST requests with JSON including \u003ccode\u003euserPrompt\u003c\/code\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45814429089971,"sku":"N8N-17993","price":65.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/x0cbW_FsyLTj7nwsEUCsN_C2p3JGP6.png?v=1786439689","url":"https:\/\/buyflowscripts.com\/products\/claude-text-generator-webhook-with-slack-preview-n8n","provider":"N8N Commerce","version":"1.0","type":"link"}