This page provides a reference for New Relic Lens actions available in the workflow automation actions catalog. These actions let you run ANSI SQL queries against data sources connected through New Relic Lens directly from a workflow step.
Prerequisites
Before using New Relic Lens actions in workflow automation, ensure you have:
A New Relic account with appropriate permissions.
One or more data sources connected in New Relic Lens.
The necessary permissions for the New Relic Lens service.
Runs an ANSI SQL query against connected data sources through New Relic Lens.
The following inputs are available for this action.
Input
Optionality
Type
Description
Example
query
Required
String
The ANSI SQL statement to execute via Lens. Supports cross-source joins across connected data sources.
accountIds
Optional
List of int
The target accounts for query execution. If you don't provide this field, the query runs against the workflow's execution account.
format
Optional
Enum
The output format for results. Accepts JSON, CSV, PSV, or TSV. Defaults to JSON.
selectors
Optional
List
The selectors to get only the specified parameters as output.
steps:
-name: queryLens
type: action
action: newrelic.lens.query
version:1
inputs:
accountIds:[12345]
query:>
SELECT appName,appId, count(*) as count FROM telemetry.Transaction
GROUP BY appName, appId LIMIT 1
selectors:
-name: resultsAsString
expression:'.results | tostring'
This action returns the following outputs.
Output
Type
Description
Example
results
List
An array of objects containing the results of the query. See Expressions property for more information.
success
Boolean
Returns true if the action succeeded, false otherwise.