Skip to content

Real-World Workflows Showcase

These examples show how complex agents can be built in ~20 lines of YAML with no custom code. Each example is a complete workflow: POST a JSON body, get a structured JSON response.

The pattern for all examples:

POST /api/v1/run  {"q": "...", ...other fields...}
        |
        v
  chat resource reads fields via get('field')
        |
        v
{"success": true, "response": {"data": {...structured output...}}}

Every agent shares the same entry point:

yaml
# workflow.yaml (same for all agents)
apiVersion: kdeps.io/v1
kind: Workflow
name: my-agent
version: "1.0.0"
targetActionId: respond
settings:
  apiServer:
    portNum: 16395
    routes:
      - path: /api/v1/run
        methods: [POST]

1. Email — sort, draft, unsubscribe

yaml
# resources/respond.yaml
actionId: respond
chat:
  prompt: |
    Email: {{ get('email') }}
    Classify as urgent / normal / unsubscribe.
    If urgent: draft a reply.
    If unsubscribe: return the sender address.
  jsonResponse: true
  jsonResponseKeys: [label, draft, unsubscribe_from]
apiResponse:
  success: true
  response:
    data: get('respond')

2. Meetings — agenda + action items

yaml
# resources/respond.yaml
actionId: respond
chat:
  prompt: |
    Meeting request: {{ get('request') }}
    Attendees: {{ get('attendees') }}
    Write a concise agenda and post-meeting action items.
  jsonResponse: true
  jsonResponseKeys: [agenda, action_items, suggested_time]
apiResponse:
  success: true
  response:
    data: get('respond')

3. Late bills — cash-flow-aware due dates

yaml
# resources/respond.yaml
actionId: respond
before:
  - httpClient:
      method: GET
      url: "{{ env('BANK_API_URL') }}/transactions"
      headers:
        Authorization: "Bearer {{ env('BANK_TOKEN') }}"
chat:
  prompt: |
    Transactions: {{ get('httpClient') }}
    Today: {{ info('timestamp') }}
    List bills due in 7 days. Flag anything overdue.
  jsonResponse: true
  jsonResponseKeys: [due_soon, overdue, balance_after]
apiResponse:
  success: true
  response:
    data: get('respond')

4. Subscription leaks — find what you forgot

yaml
# resources/respond.yaml
actionId: respond
before:
  - httpClient:
      method: GET
      url: "{{ env('BANK_API_URL') }}/transactions?days=90"
      headers:
        Authorization: "Bearer {{ env('BANK_TOKEN') }}"
chat:
  prompt: |
    Transactions: {{ get('httpClient') }}
    Find all recurring charges. Flag any not used in 30+ days.
  jsonResponse: true
  jsonResponseKeys: [subscriptions, unused, monthly_total]
apiResponse:
  success: true
  response:
    data: get('respond')
yaml
# resources/respond.yaml
actionId: respond
before:
  - component:
      name: embedding
      with:
        text: "{{ get('q') }}"
chat:
  prompt: |
    Context: {{ get('embedding').embedding }}
    Question: {{ get('q') }}
    Answer using only the context above.
apiResponse:
  success: true
  response:
    data: get('respond')

6. Grocery waste — meal plan from what's expiring

yaml
# resources/respond.yaml
actionId: respond
before:
  - httpClient:
      method: GET
      url: "{{ env('PANTRY_API') }}/inventory"
chat:
  prompt: |
    Pantry: {{ get('httpClient') }}
    Suggest 5 meals using items expiring soonest.
    List what needs reordering.
  jsonResponse: true
  jsonResponseKeys: [meals, reorder_list]
apiResponse:
  success: true
  response:
    data: get('respond')

7. Travel planning — one pass

yaml
# resources/respond.yaml
actionId: respond
before:
  - component:
      name: scraper
      with:
        url: "https://www.kayak.com/flights/{{ get('from') }}-{{ get('to') }}/{{ get('date') }}"
chat:
  prompt: |
    Trip: {{ get('from') }} → {{ get('to') }} on {{ get('date') }}
    Data: {{ get('scraper') }}
    Best flight option, hotel, and 3-day itinerary.
  jsonResponse: true
  jsonResponseKeys: [flight, hotel, itinerary]
apiResponse:
  success: true
  response:
    data: get('respond')

8. Admin overhead — generate invoice

yaml
# resources/respond.yaml
actionId: respond
chat:
  prompt: |
    Client: {{ get('client') }}
    Work done: {{ get('description') }}
    Hours: {{ get('hours') }} at {{ get('rate') }}/hr
    Generate a professional invoice.
  jsonResponse: true
  jsonResponseKeys: [invoice_number, line_items, subtotal, due_date]
apiResponse:
  success: true
  response:
    data: get('respond')

See Also

Released under the Apache 2.0 License.