{ "name": "Search the live web from a webhook and post the answer to Slack with SpecStream", "description": "A webhook sends a question; the SpecStream Search API answers it from the live web with its sources; Slack gets the answer and the pages.", "tags": [ "SpecStream", "Search", "Slack" ], "pieces": [ "@activepieces/piece-webhook", "@activepieces/piece-http", "@activepieces/piece-slack" ], "blogUrl": "https://specstream.ai/docs/integrations", "template": { "displayName": "Live web answer to Slack with SpecStream", "trigger": { "name": "trigger", "type": "PIECE_TRIGGER", "valid": true, "displayName": "Catch Webhook", "settings": { "pieceName": "@activepieces/piece-webhook", "pieceVersion": "~0.1.0", "pieceType": "OFFICIAL", "packageType": "REGISTRY", "triggerName": "catch_webhook", "input": { "authType": "none" }, "inputUiInfo": {} }, "nextAction": { "name": "step_1", "type": "PIECE", "valid": true, "displayName": "SpecStream Search API", "settings": { "pieceName": "@activepieces/piece-http", "pieceVersion": "~0.5.0", "pieceType": "OFFICIAL", "packageType": "REGISTRY", "actionName": "send_request", "input": { "method": "GET", "url": "https://api.specstream.ai/v1/web-search", "headers": { "Authorization": "Bearer {{connections['specstream_api_key']}}", "Content-Type": "application/json" }, "queryParams": { "q": "{{trigger['body']['question']}}", "passages": "true" }, "body_type": "none", "body": {}, "failsafe": false, "use_proxy": false }, "inputUiInfo": {}, "errorHandlingOptions": { "retryOnFailure": { "value": true }, "continueOnFailure": { "value": false } } }, "nextAction": { "name": "step_2", "type": "CODE", "valid": true, "displayName": "Answer and sources", "settings": { "input": { "reply": "{{step_1['body']}}" }, "sourceCode": { "packageJson": "{}", "code": "export const code = async (inputs) => {\n const d = (inputs.reply || {}).data || {};\n const a = d.answer || {};\n const sources = (d.sources || []).slice(0, 5);\n const lines = sources.map((s, i) => `${i + 1}. ${s.title} ${s.url}`).join('\\n');\n return { text: `${a.value || (d.passages && d.passages[0] && d.passages[0].text) || 'No direct answer; sources below.'}\\n${a.page || ''}\\n\\n${lines}` };\n};\n" }, "inputUiInfo": {}, "errorHandlingOptions": { "retryOnFailure": { "value": false }, "continueOnFailure": { "value": false } } }, "nextAction": { "name": "step_3", "type": "PIECE", "valid": false, "displayName": "Send to Slack", "settings": { "pieceName": "@activepieces/piece-slack", "pieceVersion": "~0.9.0", "pieceType": "OFFICIAL", "packageType": "REGISTRY", "actionName": "send_channel_message", "input": { "channel": "", "text": "{{step_2['text']}}" }, "inputUiInfo": {} } } } } }, "valid": false } }