Portal Community

Example 1: Fetch Exchange Rate (GET with Query Parameters)

Scenario: Before generating a USD invoice for a European customer, retrieve the current EUR/USD exchange rate from a forex API.

A GET request is made to a currency exchange API with the base and target currencies supplied dynamically from workflow variables. The rate is extracted from the response and stored for downstream use.

{
  "url": "https://api.exchangerate.host/latest",
  "method": "GET",
  "query_params": {
    "base": "{{ vars.invoice_currency }}",
    "symbols": "USD"
  },
  "auth_type": "api_key",
  "auth_credentials": {
    "key": "{{ env.FOREX_API_KEY }}",
    "header_name": "X-API-Key"
  },
  "timeout_ms": 10000,
  "parse_response": true
}
Expected outcome: response_body.rates.USD contains the current exchange rate. Downstream expression: {{ nodes.getExchangeRate.output.response_body.rates.USD }}.

Example 2: Create a Lead in Salesforce (POST with Bearer Auth)

Scenario: After a web form submission, create a Lead record in Salesforce using the REST API with an OAuth2 bearer token.

An upstream OAuth Token Refresh node has stored the access token in vars.sf_access_token. This node posts the lead data and captures the new Salesforce Lead ID.

{
  "url": "{{ vars.sf_instance_url }}/services/data/v58.0/sobjects/Lead",
  "method": "POST",
  "auth_type": "bearer",
  "auth_credentials": {
    "token": "{{ vars.sf_access_token }}"
  },
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "FirstName": "{{ vars.first_name }}",
    "LastName": "{{ vars.last_name }}",
    "Email": "{{ vars.email }}",
    "Company": "{{ vars.company_name }}",
    "LeadSource": "Web",
    "Status": "Open - Not Contacted"
  },
  "timeout_ms": 20000,
  "parse_response": true
}
Expected outcome: Salesforce returns {"id": "00Q...", "success": true, "errors": []}. The Lead ID is accessible as nodes.createSFLead.output.response_body.id.

Example 3: Trigger a Stripe Payment Intent (POST with API Key)

Scenario: Initiate a payment intent in Stripe for a specific order amount, using the Stripe API key stored in credentials.

{
  "url": "https://api.stripe.com/v1/payment_intents",
  "method": "POST",
  "auth_type": "basic",
  "auth_credentials": {
    "credential_id": "stripe-secret-key",
    "username": "{{ credentials.stripe-secret-key.api_key }}",
    "password": ""
  },
  "body_type": "form",
  "body": {
    "amount": "{{ vars.order_total_cents }}",
    "currency": "{{ vars.currency_code }}",
    "description": "Order {{ vars.order_number }}",
    "metadata[order_id]": "{{ vars.order_id }}",
    "automatic_payment_methods[enabled]": "true"
  },
  "timeout_ms": 15000
}
Expected outcome: Stripe returns a payment intent object with client_secret and id. The client_secret is passed to the frontend to complete payment confirmation.

Example 4: Deliver Webhook to Partner System (POST with HMAC Signature)

Scenario: After fulfilling an order, push a structured event payload to a partner's webhook URL with an HMAC-SHA256 signature for verification.

{
  "url": "{{ vars.partner_webhook_url }}",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-BizFirst-Signature": "sha256={{ hmac_sha256(json(vars.event_payload), env.PARTNER_WEBHOOK_SECRET) }}",
    "X-Delivery-ID": "{{ workflow.id }}"
  },
  "body": {
    "event": "order.fulfilled",
    "occurred_at": "{{ utcnow() }}",
    "data": {
      "order_id": "{{ vars.order_id }}",
      "customer_id": "{{ vars.customer_id }}",
      "items_shipped": "{{ vars.items_shipped }}",
      "tracking_number": "{{ vars.tracking_number }}"
    }
  },
  "timeout_ms": 10000,
  "follow_redirects": false
}
Expected outcome: Partner system receives the event, verifies the HMAC signature, and returns HTTP 200. Workflow routes to success and marks the order as notified.

Example 5: Call OpenAI GPT-4 for Text Classification

Scenario: Pass an incoming support ticket description to OpenAI's chat completion API to classify it into a support category before routing.

{
  "url": "https://api.openai.com/v1/chat/completions",
  "method": "POST",
  "auth_type": "bearer",
  "auth_credentials": {
    "credential_id": "openai-api-key"
  },
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "model": "gpt-4o",
    "temperature": 0.1,
    "max_tokens": 50,
    "messages": [
      {
        "role": "system",
        "content": "Classify the support ticket into one of: billing, technical, account, feature_request, other. Reply with only the category name."
      },
      {
        "role": "user",
        "content": "{{ vars.ticket_description }}"
      }
    ]
  },
  "timeout_ms": 30000,
  "parse_response": true
}
Expected outcome: OpenAI returns a structured response. The category is extracted via nodes.classifyTicket.output.response_body.choices[0].message.content and used in a Switch node to route the ticket to the correct team queue.