Workflow Examples: Pushover and Email

Two common workflow steps are sending a push notification and sending an email. Both use standard MCP tools – no special setup, no extra permissions beyond what those tools already require.

The flow definition rule: the step at the "start" key must have "name": "start". All other steps must have "name" matching their key. This is how the executor looks up each step after it completes.


Send a Pushover Notification

The simplest possible workflow: one step, one notification.

{
  "name": "notify-james",
  "flow": {
    "start": {
      "name": "start",
      "tool": "pushover_send",
      "args": {
        "message": "Deployment complete",
        "title": "WorkingAgents"
      },
      "done": true
    }
  },
  "input": {}
}

With input variables so the message is dynamic:

{
  "name": "notify-james",
  "flow": {
    "start": {
      "name": "start",
      "tool": "pushover_send",
      "args": {
        "message": "{{input.message}}",
        "title": "{{input.title}}"
      },
      "done": true
    }
  },
  "input": {
    "message": "New lead added: Acme Corp",
    "title": "CRM"
  }
}

Send an Email

{
  "name": "send-report",
  "flow": {
    "start": {
      "name": "start",
      "tool": "agentmail_send_message",
      "args": {
        "inboxId": "[email protected]",
        "to": ["[email protected]"],
        "subject": "Weekly Report",
        "text": "Here is your weekly summary."
      },
      "done": true
    }
  },
  "input": {}
}

With input variables:

{
  "name": "send-report",
  "flow": {
    "start": {
      "name": "start",
      "tool": "agentmail_send_message",
      "args": {
        "inboxId": "[email protected]",
        "to": ["{{input.recipient}}"],
        "subject": "{{input.subject}}",
        "text": "{{input.body}}"
      },
      "done": true
    }
  },
  "input": {
    "recipient": "[email protected]",
    "subject": "Your order is ready",
    "body": "Your order #1234 has shipped."
  }
}

Notify Then Email (Sequential)

A two-step workflow that sends a push notification first, then sends an email confirmation.

{
  "name": "alert-and-email",
  "flow": {
    "start": {
      "name": "start",
      "tool": "pushover_send",
      "args": {
        "message": "{{input.summary}}",
        "title": "Alert"
      },
      "next": "email"
    },
    "email": {
      "name": "email",
      "tool": "agentmail_send_message",
      "args": {
        "inboxId": "[email protected]",
        "to": ["{{input.recipient}}"],
        "subject": "{{input.subject}}",
        "text": "{{input.body}}"
      },
      "done": true
    }
  },
  "input": {
    "summary": "New contract signed: Acme Corp",
    "recipient": "[email protected]",
    "subject": "Contract signed",
    "body": "The Acme Corp contract has been signed. See CRM for details."
  }
}

The push notification fires first. When it completes, the executor creates the email step and runs it.


Approval Gate Before Email

An agent proposes an email. A human reviews it and approves before it sends.

{
  "name": "draft-and-send",
  "flow": {
    "start": {
      "name": "start",
      "tool": null,
      "args": {},
      "next": "send"
    },
    "send": {
      "name": "send",
      "tool": "agentmail_send_message",
      "args": {
        "inboxId": "[email protected]",
        "to": ["{{input.recipient}}"],
        "subject": "{{input.subject}}",
        "text": "{{input.body}}"
      },
      "done": true
    }
  },
  "input": {
    "recipient": "[email protected]",
    "subject": "Proposal: Q2 engagement",
    "body": "Following up on our call..."
  }
}

After creating the workflow, the agent calls workflow_get to find the pending step ID, notifies the human (via Pushover), and waits. When the human calls workflow_step_ready with the step ID, the email sends.


From IEx

{:ok, id} = WorkflowExecutor.start_workflow(
  "alert-and-email",
  %{
    "start" => %{
      "name" => "start",
      "tool" => "pushover_send",
      "args" => %{"message" => "Deploy done", "title" => "CI"},
      "next" => "email"
    },
    "email" => %{
      "name" => "email",
      "tool" => "agentmail_send_message",
      "args" => %{
        "inboxId" => "[email protected]",
        "to" => ["[email protected]"],
        "subject" => "Deploy complete",
        "text" => "Production deploy finished successfully."
      },
      "done" => true
    }
  },
  %{},
  "james"
)