n8n ➔ SendGrid Payload Specification

Technical reference for automating data exchange between Workflow Automation and Email API workflows.

💡 How this integration works:

1. n8n triggers an event when workflow.executed occurs.
2. Data is packaged into a standard JSON webhook payload.
3. Payload is delivered into your SendGrid intake pipeline and mapped to your Email API targets.

Authentication & Event Specs

ParameterSource (n8n)Destination (SendGrid)
Auth MechanismHeader Auth / BasicBearer API Key
Trigger Eventworkflow.executedIngest Pipeline

Sample Webhook JSON Payload

{
  "event": "workflow.executed_to_sendgrid",
  "timestamp": 1788105197,
  "source": {
    "platform": "n8n",
    "auth_mode": "Header Auth / Basic",
    "data": {
      "execution_id": "sample_execution_id_val",
      "workflow_name": "sample_workflow_name_val",
      "node_output": "sample_node_output_val",
      "timestamp": "sample_timestamp_val"
    }
  },
  "destination": {
    "platform": "SendGrid",
    "auth_mode": "Bearer API Key",
    "target_endpoint": "https://api.sendgrid.com/v1/ingest",
    "mapped_fields": {
      "msg_id": "{{source.execution_id}}",
      "recipient": "{{source.workflow_name}}",
      "event_type": "{{source.node_output}}",
      "smtp_code": "{{source.timestamp}}"
    }
  }
}

Quick Integration Setup

  1. Retrieve your secret API credentials from your n8n developer dashboard using authentication method Header Auth / Basic.
  2. Configure the target endpoint URL to route payloads into the SendGrid intake pipeline.
  3. Map incoming schema properties according to the JSON specification detailed above.

Expected HTTP Response Codes

Status CodeMeaningTroubleshooting Step
200 OKSuccessPayload accepted and queued for routing.
401 UnauthorizedAuth FailureVerify headers for valid Header Auth / Basic credentials.
422 UnprocessableSchema ErrorCheck field keys alignment between source and target payload.

Related Technical Specifications