• /
  • EnglishEspañolFrançais日本語한국어Português
  • EntrarComeçar agora

Send a report to Slack

Execute NRQL query, convert results to CSV, and post to Slack.

Requirements:

  • NRQL query
  • Slack token in secrets.

What this workflow does:

  • Execute NRQL query against New Relic account
  • Generate CSV from query results
  • Post CSV to Slack channel with message

Key actions: newrelic.nrdb.query, utils.transform.toCSV, slack.chat.postMessage

name: nrqlToSlackReport
workflowInputs:
accountId:
type: Int
nrqlQuery:
type: String
defaultValue: 'FROM Transaction SELECT count(*) FACET appName SINCE 1 hour ago'
slackChannel:
type: String
steps:
- name: queryData
type: action
action: newrelic.nrdb.query
version: 1
inputs:
accountIds:
- ${{ .workflowInputs.accountId }}
query: ${{ .workflowInputs.nrqlQuery }}
- name: convertToCSV
type: action
action: utils.transform.toCSV
version: 1
inputs:
data: ${{ .steps.queryData.outputs.results | tostring }}
- name: postToSlack
type: action
action: slack.chat.postMessage
version: 1
inputs:
token: ${{ :secrets:slack_token }}
channel: ${{ .workflowInputs.slackChannel }}
text: 'NRQL Query Report'
attachment:
filename: 'query-results.csv'
content: ${{ .steps.convertToCSV.outputs.csv }}

What's next

Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.