How to Integrate with Pipedream
Learn how to use the SnackPrompt AI Engine API to build powerful automations and AI-powered workflows in Pipedream.
Overview
Pipedream is a developer-focused integration platform with native code support. It offers several ways to integrate APIs:
HTTP Request Action
No-code
Simple API calls without coding
Node.js Code Step
Full control
Custom JavaScript/TypeScript code
Python Code Step
Data processing
Python for complex transformations
Custom Component
Reusable
Create shareable integration components
Integration Architecture
┌─────────────────────────────────────────────────────────┐
│ Pipedream │
│ ┌─────────────┐ ┌─────────────┐ ┌────────────┐ │
│ │ Trigger │──▶│ Code/HTTP │──▶│ Action │ │
│ │ Source │ │ Step │ │ │ │
│ └─────────────┘ └──────┬──────┘ └────────────┘ │
│ │ │
│ ┌──────▼──────┐ │
│ │ $export │ │
│ │ (state) │ │
│ └──────┬──────┘ │
└────────────────────────────┼────────────────────────────┘
│
▼
┌──────────────────────────────┐
│ SnackPrompt AI Engine API │
│ /v1/kb/search or /v1/kb/chat│
└──────────────────────────────┘Method 1: Node.js Code Step (Recommended)
Pipedream excels at code-based integrations. Use Node.js for full control.
Step 1: Create a New Workflow
Go to pipedream.com
Click New > Workflow
Choose your trigger (HTTP, Schedule, App event, etc.)
Step 2: Add Node.js Code Step
Click + to add a step
Select Code > Node.js
Add the code below
Search Knowledge Base
Chat with Knowledge Base
Method 2: HTTP Request Action (No-Code)
For simple integrations without custom code.
Step 1: Add HTTP Request Step
Click + to add a step
Search for HTTP / Webhook
Select Send any HTTP Request
Step 2: Configure Request
Method
POST
URL
https://api-integrations.snackprompt.com/v1/kb/search
Headers:
Content-Type
application/json
x-api-key
{{steps.trigger.event.headers["x-api-key"]}} or configure in Auth
Body:
Step 3: Use Results
Reference in subsequent steps:
{{steps.http_request.$return_value.items}}{{steps.http_request.$return_value.items[0].payload.original_text}}
Method 3: Python Code Step
For data scientists or Python-preferred developers.
Search with Python
Method 4: Custom Component (Reusable)
Create a reusable component for your organization.
Create Component
App Definition
Practical Use Cases
1. Webhook-Based Chatbot
2. Slack Bot
3. Email Auto-Responder
4. RAG with OpenAI
5. Scheduled Knowledge Sync
Environment Variables
Store sensitive data in Pipedream environment variables:
Go to Settings > Environment Variables
Add:
SNACKPROMPT_API_KEYSNACKPROMPT_TENANT_ID
Access in code:
Configuration Tips
1. Use Props for Configurability
2. Error Handling
3. Data Validation
4. Response Caching
5. Parallel Requests
Troubleshooting
Error: "tenant_id is required"
Ensure tenant_id is inside the filters object:
Error: "Request failed with status 401"
Check API key is correct
Verify API key is not expired
Ensure header name is exactly
x-api-key
Empty Results
Verify tenant_id is correct
Remove tag_names filter to search all content
Check query string is not empty
Test API directly with curl
Workflow Times Out
Reduce limit parameter
Add timeout to axios request:
Consider async/webhook pattern for long operations
Related
External Resources
Last updated
Was this helpful?