{"product_id":"answer-document-questions-via-webhooks-with-anthropic-claude","title":"Answer Document Questions via Webhooks with Anthropic Claude","description":"\u003ch3\u003eAsk questions about your own documents—instantly—using an n8n webhook and Anthropic Claude\u003c\/h3\u003e\n\u003cp\u003eThis workflow exposes a production-ready \u003cstrong\u003ePOST webhook\u003c\/strong\u003e that lets you send a question and receive a \u003cstrong\u003egrounded, cited answer as JSON\u003c\/strong\u003e. It works by chunking your pasted documents, selecting the most relevant excerpts, and having \u003cstrong\u003eAnthropic Claude\u003c\/strong\u003e answer strictly from the provided text.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives\u003c\/strong\u003e a webhook request (POST) containing JSON with a \u003cem\u003equestion\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLoads \u0026amp; chunks\u003c\/strong\u003e your documents from the workflow’s \u003ccode\u003eDOCS\u003c\/code\u003e array, splitting content into sections by \u003ccode\u003e##\u003c\/code\u003e headings.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRetrieves relevant excerpts\u003c\/strong\u003e by scoring all sections using keyword overlap with the question, keeping the top-matching excerpts.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCalls Anthropic Claude\u003c\/strong\u003e via the Anthropic Messages API, sending the question plus the retrieved text and instructing Claude to answer only from the provided excerpts and \u003cstrong\u003ecite each claim\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eResponds\u003c\/strong\u003e to the webhook caller with \u003ccode\u003e{ \"answer\": ..., \"sources\": ... }\u003c\/code\u003e, including the selected section names as sources.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDocument Q\u0026amp;A for internal teams\u003c\/strong\u003e: ask policy, procedure, or documentation questions and get cited answers.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSaaS operator support\u003c\/strong\u003e: route customer-facing documentation questions to a webhook-driven answer flow.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAutomation engineering\u003c\/strong\u003e: embed “ask-your-docs” behavior into other apps by posting \u003ccode\u003e{ \"question\": \"...\" }\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReduce hallucinations\u003c\/strong\u003e: require Claude to rely only on excerpts selected from your provided documents.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNodes\/steps used\u003c\/strong\u003e: code (chunking\/scoring), webhook, sticky note, http request, respond to webhook.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAnthropic integration\u003c\/strong\u003e: configure HTTP Header Auth with \u003ccode\u003ex-api-key\u003c\/code\u003e, and send \u003ccode\u003eanthropic-version: 2023-06-01\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWebhook endpoint\u003c\/strong\u003e: use the production webhook URL for \u003ccode\u003e\/ask-your-docs\u003c\/code\u003e and POST a JSON body like \u003ccode\u003e{ \"question\": \"...\" }\u003c\/code\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eSetup note:\u003c\/strong\u003e paste your documents into the workflow’s \u003ccode\u003eDOCS\u003c\/code\u003e array and use \u003ccode\u003e##\u003c\/code\u003e headings to create citeable sections.\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45755361165491,"sku":"N8N-17730","price":10.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/DMesLd0RtvchJap7TUM-A_zPLfaUmi.png?v=1785661434","url":"https:\/\/buyflowscripts.com\/products\/answer-document-questions-via-webhooks-with-anthropic-claude","provider":"N8N Commerce","version":"1.0","type":"link"}