---
title: Send events to New Relic
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/ingest/newrelic-ingest-send-events
---

Reports custom events to New Relic.

For prerequisites, see [New Relic Ingest actions](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/ingest/newrelic-ingest#prerequisites).

## Send events to New Relic

The action identifier is `newrelic.ingest.sendEvents`.

Reports a custom event to New Relic.

### Inputs

The following table describes all available input fields for this action.

| Input          | Type   | Description                                                                                                                                                                                                                                                                                                                                                            | Example                                                                                                                                       |
| -------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **attributes** | Map    | **Optional.** Common attributes included in all events when provided. Merges with each event item; event-level values override common attributes when conflicts occur.                                                                                                                                                                                                 | `"{\"page\": \"1\", \"limit\": \"10\"}"`                                                                                                      |
| **events**     | List   | **Required.** The list of event data. Events require an eventType field that represents the custom event type. The maximum events allowed per request is 100.                                                                                                                                                                                                          | `"[{\"eventType\":\"XYZ\",\"attributes\":{\"foo\":\"bar\"}}, {\"eventType\":\"ABC\",\"value\":\"1234\",\"attributes\":{\"color\":\"red\"}}]"` |
| **licenseKey** | String | **Optional.** The New Relic Account License Key specifies the target account for your events. If not provided, the system uses the default license key from the account executing the workflow. [Read more about our API keys](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys#license-key) to create and manage your New Relic Account License Key. | `"{{ .secrets.secretName }}"`, where `secretName` is the key under which the license key is stored.                                           |
| **selectors**  | List   | **Optional.** The selectors to get only the specified parameters as output.                                                                                                                                                                                                                                                                                            | `[{\"name\": \"success\", \"expression\": \".success\"}]`                                                                                     |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                   |
| ---------------- | ------- | --------------------------------------------- |
| **success**      | Boolean | `true` on success, `false` on failure.        |
| **errorMessage** | String  | Failure reason as message. `null` on success. |

### Example

The following example sends multiple custom events with shared and per-event attributes, then retrieves them with a NRQL query.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: heartbeat_newrelicIngestSendEvents  workflowInputs:   cellName:     type: String  steps:   - name: runAction     type: action     action: newrelic.ingest.sendEvents     version: 1     inputs:       attributes:         colour: red         id: 1234       events:         - eventType: HeartBeat           test: "OK"           attributes:             foo: bar         - eventType: HeartBeat1234           test: "OK1234"           attributes:             foo: bar         - eventType: HeartBeat12345           test: "OK12345"           attributes:             foo: bar             colour: yellow         - eventType: HeartBeat12345678           test: "OK12345678"       selectors:         - name: success           expression: ".success" ``` **Expected output:** ```yaml   {     "success": true   } ``` **Retrieve events:** After successfully executing a workflow, you can retrieve the associated event by running a query under the account that executed the workflow: ```sql SELECT * FROM HeartBeat ``` |
