Communication & Integration Nodes

Connect to external services via HTTP, email, webhooks, and real-time protocols

Communication & Integration Nodes

Communication nodes are your bridge to the outside world. Call APIs, send emails, receive webhooks, stream data in real-time. Let's connect your workflows to everything.


HTTP Request Node

When to use: When you need to call a REST API—fetch data, post data, or trigger an action on an external service.

The HTTP Request Node makes web calls with full control over headers, authentication, and request bodies.

Configuration

Configuration:
  url: "https://api.example.com/users"
  method: GET | POST | PUT | DELETE | PATCH
  headers:
    Authorization: "Bearer {{ credentials.token }}"
    Content-Type: "application/json"
  body: "{{ input.payload }}"
  auth_type: none | bearer | basic | api_key | oauth2

Example 1: Fetch User Data from API

When to use: Look up user information from an external system.

HTTP Request Configuration:

url: "https://api.github.com/users/{{ input.username }}"
method: GET
headers:
  Accept: "application/vnd.github.v3+json"
  Authorization: "Bearer {{ credentials.github_token }}"
auth_type: bearer

Response:

{
  "login": "alice",
  "id": 12345,
  "name": "Alice Johnson",
  "public_repos": 42,
  "followers": 256
}

Example 2: Create Record via API (POST)

When to use: Create new records in an external system like Stripe, Slack, or your database.

Incoming data:

{
  "customer_name": "Alice Johnson",
  "email": "alice@example.com",
  "amount": 99.99
}

HTTP Request Configuration:

url: "https://api.stripe.com/v1/customers"
method: POST
headers:
  Content-Type: "application/x-www-form-urlencoded"
  Authorization: "Bearer {{ credentials.stripe_secret_key }}"
body: |
  name={{ input.customer_name }}
  email={{ input.email }}
  description=Created by DeepChain
auth_type: bearer

Response:

{
  "id": "cus_abc123xyz",
  "object": "customer",
  "name": "Alice Johnson",
  "email": "alice@example.com"
}

Example 3: Update Record (PATCH)

When to use: Update existing records—change status, update fields, etc.

Incoming data:

{
  "order_id": "ORD-123",
  "new_status": "shipped",
  "tracking_number": "1Z999AA10123456784"
}

HTTP Request Configuration:

url: "https://api.example.com/orders/{{ input.order_id }}"
method: PATCH
headers:
  Content-Type: "application/json"
  Authorization: "Bearer {{ credentials.api_token }}"
body: |
  {
    "status": "{{ input.new_status }}",
    "tracking_number": "{{ input.tracking_number }}"
  }

Example 4: API with Basic Authentication

When to use: Services that use basic auth (username/password encoded in header).

HTTP Request Configuration:

url: "https://api.example.com/protected"
method: GET
auth_type: basic

DeepChain automatically encodes credentials as Authorization: Basic base64(username:password)

Example 5: Handle API Response Errors

Combine with If Node to handle different status codes:

HTTP Request
  ├─ 200-299: Success path
     
     Process data
  
  ├─ 400-499: Client error
     
     Log error, notify user
  
  └─ 500-599: Server error
      
      Retry with Delay node

Warning: Never hardcode API keys in your workflow! Use credential references like {{ credentials.api_key }}. Keys are stored securely in your DeepChain vault.


Email Node

When to use: When you need to send or receive emails.

The Email Node handles sending transactional emails, reading incoming emails, and sending replies.

Configuration

Configuration:
  operation: send | read | reply
  to: ["user@example.com"]
  subject: "Order Confirmation"
  body: "Your order {{ input.order_id }} is confirmed."
  attachments: []

Example 1: Send Order Confirmation Email

Incoming order data:

{
  "order_id": "ORD-123",
  "customer_email": "alice@example.com",
  "customer_name": "Alice",
  "total": 99.99,
  "items_count": 3
}

Email Node Configuration:

operation: send
to: ["{{ input.customer_email }}"]
subject: "Order {{ input.order_id }} Confirmed"
body: |
  Hi {{ input.customer_name }},

  Thank you for your order! Here are the details:

  Order ID: {{ input.order_id }}
  Items: {{ input.items_count }}
  Total: ${{ input.total }}

  We'll send tracking info soon.

  Best regards,
  The Team

Example 2: Send Email with Attachment

operation: send
to: ["alice@example.com"]
subject: "Your Invoice"
body: "Please see attached invoice."
attachments:
  - file_path: "/invoices/INV-{{ input.invoice_id }}.pdf"
    content_type: "application/pdf"

Example 3: Read Incoming Emails

operation: read
mailbox: "support@example.com"
query: "is:unread from:customers@domain.com"
limit: 10

Perfect for processing customer inquiries!

Example 4: Reply to Email

operation: reply
email_id: "{{ input.email_message_id }}"
subject: "Re: {{ input.original_subject }}"
body: |
  Thank you for your inquiry!

  We'll get back to you within 24 hours.

  Regards,
  Support Team

Tip: Use templates and expressions to personalize emails. {{ input.customer_name }} is much better than a generic greeting!


Notification Node

When to use: When you need to notify someone across multiple channels—send to Slack, email, SMS, Discord, etc. all in one node.

The Notification Node simplifies multi-channel alerting. Configure once, notify everywhere.

Configuration

Configuration:
  channels: [email, slack, sms, push, discord, teams, webhook]
  message: "{{ input.alert_message }}"
  urgency: low | normal | high | critical

Example 1: Multi-Channel Alert

Incoming alert data:

{
  "alert_type": "payment_failed",
  "user_id": "USER-123",
  "email": "alice@example.com",
  "slack_user_id": "U123456",
  "phone": "+1-555-0101"
}

Notification Node Configuration:

channels: [email, slack, sms]
message: |
  Payment failed for account {{ input.user_id }}.
  Please update your payment method.
urgency: high

This automatically sends:

  1. Email to alice@example.com
  2. Slack DM to user U123456
  3. SMS to +1-555-0101

Example 2: Critical Alert to Multiple Teams

channels: [email, slack, teams]
message: |
  CRITICAL: Database query taking 30+ seconds.
  Service: {{ input.service_name }}
  Duration: {{ input.duration }}ms
  Time: {{ now() }}
urgency: critical
recipients:
  email: ["ops@company.com", "engineering@company.com"]
  slack: ["#alerts", "#ops"]
  teams: ["On-Call Team"]

Example 3: Discord Notification

channels: [discord]
message: |
  New order received!
  Order ID: {{ input.order_id }}
  Customer: {{ input.customer_name }}
  Total: ${{ input.total }}
urgency: normal
webhook_url: "{{ credentials.discord_webhook }}"

Webhook Trigger Node

When to use: When you want external systems to trigger your workflow—Stripe payments, GitHub pushes, Shopify orders, etc.

The Webhook Trigger Node creates a public URL that external services can POST to. Your workflow starts when it receives a webhook.

Configuration

Configuration:
  path: "/webhooks/my-trigger"
  method: POST
  authentication: none | api_key | hmac

Example 1: Stripe Payment Webhook

Create a Stripe webhook pointing to:

https://deepchain.example.com/webhooks/stripe-payment

Webhook Trigger Configuration:

path: "/webhooks/stripe-payment"
method: POST
authentication: hmac
secret_key: "{{ credentials.stripe_webhook_secret }}"

Incoming Stripe webhook:

{
  "type": "charge.succeeded",
  "data": {
    "object": {
      "id": "ch_1234567890",
      "amount": 9999,
      "currency": "usd",
      "customer": "cus_abc123"
    }
  }
}

Workflow continues with this data:

Webhook Trigger (receives Stripe event)
  ↓
Data Transform (extract relevant fields)
  ↓
Database (record payment)
  ↓
Email (send confirmation)
  ↓
Log (mark as processed)

Example 2: GitHub Push Webhook

path: "/webhooks/github-push"
method: POST
authentication: hmac

Incoming GitHub webhook:

{
  "repository": {
    "name": "my-repo",
    "full_name": "alice/my-repo"
  },
  "pusher": {
    "name": "alice",
    "email": "alice@example.com"
  },
  "commits": [
    {
      "id": "abc123def456",
      "message": "Fix: Handle null pointer exception",
      "url": "https://github.com/alice/my-repo/commit/abc123"
    }
  ]
}

Workflow could automatically:

  • Run tests
  • Deploy to staging
  • Notify team
  • Log deployment

Example 3: HMAC Verification (Security)

Always use HMAC authentication for webhooks:

path: "/webhooks/secure-event"
method: POST
authentication: hmac
secret_key: "your_webhook_secret"

DeepChain automatically verifies the HMAC signature to ensure the request came from the expected source.


Webhook API Node

When to use: When you need advanced API integration—GraphQL, SOAP, or complex REST APIs.

The Webhook API Node handles more complex API patterns beyond simple REST.

Configuration

Configuration:
  type: rest | graphql | soap | rpc
  endpoint: "https://api.example.com/graphql"
  query: "query { users { id name } }"

Example 1: GraphQL Query

GraphQL API Endpoint:

https://api.github.com/graphql

Webhook API Configuration:

type: graphql
endpoint: "https://api.github.com/graphql"
query: |
  query {
    user(login: "{{ input.username }}") {
      name
      email
      repositories(first: 10) {
        nodes {
          name
          description
          stars: stargazerCount
        }
      }
    }
  }
headers:
  Authorization: "Bearer {{ credentials.github_token }}"

Response:

{
  "user": {
    "name": "Alice Johnson",
    "email": "alice@example.com",
    "repositories": [...]
  }
}

Example 2: SOAP Request

type: soap
endpoint: "https://webservice.example.com/soap"
action: "GetCustomer"
body: |
  <soap:Envelope xmlns:soap="...">
    <soap:Body>
      <GetCustomer>
        <CustomerID>{{ input.customer_id }}</CustomerID>
      </GetCustomer>
    </soap:Body>
  </soap:Envelope>

Real-Time Communication Node

When to use: When you need persistent, real-time connections—WebSocket streams, Server-Sent Events, etc.

The Real-Time Communication Node handles streaming data from external services.

Configuration

Configuration:
  protocol: websocket | sse | webrtc
  url: "wss://stream.example.com"
  events: ["message", "update", "error"]

Example 1: WebSocket Stream

Real-Time Communication Configuration:

protocol: websocket
url: "wss://stream.coinbase.com/ws"
events: ["subscribe", "message", "unsubscribe"]

First message (subscription):

{
  "type": "subscribe",
  "product_ids": ["BTC-USD"]
}

Incoming messages (real-time):

{
  "type": "ticker",
  "product_id": "BTC-USD",
  "price": "42500.00",
  "time": "2025-02-10T14:30:00Z"
}

Workflow could:

  • Log price changes
  • Alert if price crosses threshold
  • Update database
  • Send notifications

Example 2: Server-Sent Events (SSE)

protocol: sse
url: "https://api.example.com/stream/events"
headers:
  Authorization: "Bearer {{ credentials.token }}"
events: ["update", "notification", "error"]

Perfect for real-time notifications, live updates, etc.


Chat Input Node

When to use: When you want to trigger a workflow from user chat input—for chatbots, interactive workflows, etc.

The Chat Input Node waits for a user to type a message, then passes it to the workflow.

Example: Simple Chatbot

Chat Input
  ↓
AI Agent (respond to user message)
  ↓
Email/Notification (send response)

Common Communication Patterns

Pattern 1: API Integration with Error Handling

Start
  ↓
HTTP Request (call external API)
  ├─ Success (2xx) → Process response
  │   ↓
  │   Data Transform
  │   ↓
  │   Database Insert
  │
  └─ Error (4xx/5xx) → Handle error
      ├─ Log error
      ├─ Send alert email
      └─ Retry with Delay

Pattern 2: Webhook Reception and Processing

Webhook Trigger (Stripe payment)
  ↓
Verify HMAC signature
  ↓
Data Parser (extract payload)
  ↓
Database (record transaction)
  ↓
Email (send confirmation)
  ↓
Notification (notify admin)

Pattern 3: Real-Time Monitoring

Webhook Trigger (initial request)
  ↓
Real-Time Communication (open WebSocket)
  ├─ Receive update 1 → Process
  ├─ Receive update 2 → Process
  ├─ Receive update 3 → Process
  └─ Stream ends → Close connection

Authentication Best Practices

Auth Type When to Use Example
None Public APIs OpenWeather free tier
API Key Simple key-based Stripe, SendGrid
Bearer Token OAuth, JWT GitHub, Google APIs
Basic Auth Username/password Some legacy APIs
HMAC Webhook verification Stripe webhooks
OAuth2 User delegation Login with Google/GitHub

Security: Store all credentials in DeepChain's secure vault. Never commit API keys to code or documentation!


Next Steps