published on Tuesday, Jun 23, 2026 by Pulumi
published on Tuesday, Jun 23, 2026 by Pulumi
Use this resource to create and manage New Relic Workflow Automation.
Workflow Automation allows you to define automated workflows using YAML definitions. These workflows can scope to either an account or an organization and support various automation steps and configurations.
Example Usage
Basic Workflow Automation with ACCOUNT Scope
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const testQuery = new newrelic.WorkflowAutomation("test_query", {
name: "test_query_workflow",
scopeId: "your-account-id",
scopeType: "ACCOUNT",
definition: `name: test_query_workflow
description: Simple workflow that queries NRDB and waits
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Log LIMIT 10
- name: wait
type: wait
seconds: 3
signals: []
next: end
`,
});
import pulumi
import pulumi_newrelic as newrelic
test_query = newrelic.WorkflowAutomation("test_query",
name="test_query_workflow",
scope_id="your-account-id",
scope_type="ACCOUNT",
definition="""name: test_query_workflow
description: Simple workflow that queries NRDB and waits
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Log LIMIT 10
- name: wait
type: wait
seconds: 3
signals: []
next: end
""")
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := newrelic.NewWorkflowAutomation(ctx, "test_query", &newrelic.WorkflowAutomationArgs{
Name: pulumi.String("test_query_workflow"),
ScopeId: pulumi.String("your-account-id"),
ScopeType: pulumi.String("ACCOUNT"),
Definition: pulumi.String(`name: test_query_workflow
description: Simple workflow that queries NRDB and waits
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Log LIMIT 10
- name: wait
type: wait
seconds: 3
signals: []
next: end
`),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var testQuery = new NewRelic.WorkflowAutomation("test_query", new()
{
Name = "test_query_workflow",
ScopeId = "your-account-id",
ScopeType = "ACCOUNT",
Definition = @"name: test_query_workflow
description: Simple workflow that queries NRDB and waits
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Log LIMIT 10
- name: wait
type: wait
seconds: 3
signals: []
next: end
",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.WorkflowAutomation;
import com.pulumi.newrelic.WorkflowAutomationArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testQuery = new WorkflowAutomation("testQuery", WorkflowAutomationArgs.builder()
.name("test_query_workflow")
.scopeId("your-account-id")
.scopeType("ACCOUNT")
.definition("""
name: test_query_workflow
description: Simple workflow that queries NRDB and waits
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Log LIMIT 10
- name: wait
type: wait
seconds: 3
signals: []
next: end
""")
.build());
}
}
resources:
testQuery:
type: newrelic:WorkflowAutomation
name: test_query
properties:
name: test_query_workflow
scopeId: your-account-id
scopeType: ACCOUNT
definition: |
name: test_query_workflow
description: Simple workflow that queries NRDB and waits
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Log LIMIT 10
- name: wait
type: wait
seconds: 3
signals: []
next: end
pulumi {
required_providers {
newrelic = {
source = "pulumi/newrelic"
}
}
}
resource "newrelic_workflowautomation" "test_query" {
name = "test_query_workflow"
scope_id = "your-account-id"
scope_type = "ACCOUNT"
definition = "name: test_query_workflow\ndescription: Simple workflow that queries NRDB and waits\nsteps:\n - name: queryNrdb\n type: action\n action: newrelic.nrdb.query\n version: 1\n inputs:\n query: SELECT count(*) from Log LIMIT 10\n - name: wait\n type: wait\n seconds: 3\n signals: []\n next: end\n"
}
Workflow Automation with ORGANIZATION Scope
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const orgQuery = new newrelic.WorkflowAutomation("org_query", {
name: "org_query_workflow",
scopeId: "your-organization-id",
scopeType: "ORGANIZATION",
definition: `name: org_query_workflow
description: Organization-level workflow that queries NRDB
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Transaction LIMIT 10
- name: wait
type: wait
seconds: 5
signals: []
next: end
`,
});
import pulumi
import pulumi_newrelic as newrelic
org_query = newrelic.WorkflowAutomation("org_query",
name="org_query_workflow",
scope_id="your-organization-id",
scope_type="ORGANIZATION",
definition="""name: org_query_workflow
description: Organization-level workflow that queries NRDB
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Transaction LIMIT 10
- name: wait
type: wait
seconds: 5
signals: []
next: end
""")
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := newrelic.NewWorkflowAutomation(ctx, "org_query", &newrelic.WorkflowAutomationArgs{
Name: pulumi.String("org_query_workflow"),
ScopeId: pulumi.String("your-organization-id"),
ScopeType: pulumi.String("ORGANIZATION"),
Definition: pulumi.String(`name: org_query_workflow
description: Organization-level workflow that queries NRDB
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Transaction LIMIT 10
- name: wait
type: wait
seconds: 5
signals: []
next: end
`),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var orgQuery = new NewRelic.WorkflowAutomation("org_query", new()
{
Name = "org_query_workflow",
ScopeId = "your-organization-id",
ScopeType = "ORGANIZATION",
Definition = @"name: org_query_workflow
description: Organization-level workflow that queries NRDB
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Transaction LIMIT 10
- name: wait
type: wait
seconds: 5
signals: []
next: end
",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.WorkflowAutomation;
import com.pulumi.newrelic.WorkflowAutomationArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var orgQuery = new WorkflowAutomation("orgQuery", WorkflowAutomationArgs.builder()
.name("org_query_workflow")
.scopeId("your-organization-id")
.scopeType("ORGANIZATION")
.definition("""
name: org_query_workflow
description: Organization-level workflow that queries NRDB
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Transaction LIMIT 10
- name: wait
type: wait
seconds: 5
signals: []
next: end
""")
.build());
}
}
resources:
orgQuery:
type: newrelic:WorkflowAutomation
name: org_query
properties:
name: org_query_workflow
scopeId: your-organization-id
scopeType: ORGANIZATION
definition: |
name: org_query_workflow
description: Organization-level workflow that queries NRDB
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Transaction LIMIT 10
- name: wait
type: wait
seconds: 5
signals: []
next: end
pulumi {
required_providers {
newrelic = {
source = "pulumi/newrelic"
}
}
}
resource "newrelic_workflowautomation" "org_query" {
name = "org_query_workflow"
scope_id = "your-organization-id"
scope_type = "ORGANIZATION"
definition = "name: org_query_workflow\ndescription: Organization-level workflow that queries NRDB\nsteps:\n - name: queryNrdb\n type: action\n action: newrelic.nrdb.query\n version: 1\n inputs:\n query: SELECT count(*) from Transaction LIMIT 10\n - name: wait\n type: wait\n seconds: 5\n signals: []\n next: end\n"
}
YAML Definition Structure
The definition argument accepts a YAML string that defines the workflow’s structure and logic.
Top-Level Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | String | Yes | The name of the workflow. Must match the name argument in the Terraform resource. |
description | String | No | A brief summary of what the workflow does. Recommended for clarity. |
workflowInputs | Object | No | A map of input variables that can be passed to the workflow at runtime. |
steps | Array | Yes | An ordered array of step objects that define the workflow’s logic. |
Workflow Inputs
Define inputs to make your workflows more flexible and reusable.
workflowInputs:
inputName:
type: String # Supported types include: String, Int, Boolean, List, Map
defaultValue: "value" # Optional default value for the input
required: false # Optional, defaults to true. If true, a value must be provided.
validations: # Optional array of validation rules
- type: regex
errorMessage: "Custom error message"
pattern: ^[a-zA-Z0-9]+$
- Inputs can reference secrets using the syntax:
${{ :secrets:secretName }}
Input Validation Types
Workflow inputs support various validation types to ensure data integrity:
emailDestinationId:
type: String
validations:
- type: regex
errorMessage: "Must be a valid UUID"
pattern: ^[a-fA-F0-9]{8}-([a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12}$
- Integer Range Validation:
threshold:
type: Int
defaultValue: 5000
validations:
- type: minIntValue
errorMessage: "Minimum value must be at least 100"
minValue: 100
- type: maxIntValue
errorMessage: "Maximum value must be less than 10000"
maxValue: 10000
Note: By default, integer variables accept both positive and negative values. If you define a minIntValue validation, the field rejects any value below that threshold. For example, setting minIntValue: 0 prevents negative integers from being entered.
- List Type:
skipUsers:
type: List
defaultValue:
- "user1@example.com"
- "user2@example.com"
Note: This list is case sensitive.
Step Types
Each object in the steps array defines a single unit of work. The primary step types are action, wait, switch, and loop.
Action Steps
Executes a specific function, such as querying data or sending a notification.
type: action- Defines the step as an action.action- The specific action to execute (example,newrelic.nrdb.query).version- The version of the action to use.inputs- A map of input parameters for the action.
Example:
- name: sendLogs
type: action
action: newrelic.ingest.sendLogs
version: '1'
inputs:
logs:
- message: "This is a test log from Workflow Automation"
Common actions include:
newrelic.nrdb.query- Query New Relic databaseutils.transform.toCSV- Transform data to CSV formatslack.chat.postMessage- Send messages to Slack
Available actions A complete list of available actions, their versions, and required inputs can be found in the Workflow Action Catalog.
Wait steps
Pauses the workflow for a specified duration or until it receives a signal.
type: waitseconds- The number of seconds to pause.signals- (Optional) An array of signals to wait for. See SignalWorkflowRun for more informationnext- (Optional) The name of the next step. Useendto terminate the workflow.
Example:
- name: wait
type: wait
seconds: 15
Switch steps
Provides conditional branching logic.
type: switchswitch- An array of conditions to evaluate in order.condition- A JQ expression that evaluates totrueorfalse.next- The name of the step to execute if the condition is true. Theswitchblock can also have a top-levelnextfield to define the default step if no conditions match.
Example:
- name: hasCompleted
type: switch
switch:
- condition: ${{ .steps.waitForCompletion.outputs.status == "Failed" }}
next: displayError
- condition: ${{ .steps.waitForCompletion.outputs.status == "Success" }}
next: displaySuccess
Loop steps
Iterates over a set of values and executes a sequence of steps for each iteration.
type: loopfor.in- A JQ expression that returns an array to iterate over.steps- An array of steps to execute for each iteration. Inside the loop, you can usenext: continueto skip to the next iteration ornext: breakto exit the loop.
Example:
- name: loopStep
type: loop
for:
in: ${{ [range(0; 5)] }}
steps:
- name: sendLogs
type: action
action: newrelic.ingest.sendLogs
version: '1'
inputs:
logs:
- message: "This is a test log from Workflow Automation"
next: continue
Referencing Data in Workflows
You can dynamically reference data from inputs, secrets, and other steps using JQ-like template expressions.
| Data Source | Syntax | Example |
|---|---|---|
| Workflow Inputs | ${{ .workflowInputs.inputName }} | ${{ .workflowInputs.ccuThreshold }} |
| Step Outputs | ${{ .steps.stepName.outputs.fieldName }} | ${{ .steps.query1.outputs.results }} |
| Loop Elements | ${{ .steps.loopStepName.loop.element }} | ${{ .steps.loopStep1.loop.element.email }} |
| Secrets | ${{ :secrets:secretName }} | ${{ :secrets:myApiKey }} |
Example YAML Structure
Simple workflow with query and wait:
name: example-workflow
description: Query logs and wait
steps:
- name: queryNrdb
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: SELECT count(*) from Log LIMIT 10
- name: wait
type: wait
seconds: 5
next: end
Advanced workflow with inputs and multiple actions:
name: advanced-workflow
workflowInputs:
accountId:
type: String
query:
type: String
steps:
- name: runQuery
type: action
action: newrelic.nrdb.query
version: 1
inputs:
accountIds: "${{ .workflowInputs.accountId }}"
query: "${{ .workflowInputs.query }}"
- name: transformData
type: action
action: utils.transform.toCSV
version: 1
inputs:
data: '${{ .steps.runQuery.outputs.results }}'
Create WorkflowAutomation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new WorkflowAutomation(name: string, args: WorkflowAutomationArgs, opts?: CustomResourceOptions);@overload
def WorkflowAutomation(resource_name: str,
args: WorkflowAutomationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def WorkflowAutomation(resource_name: str,
opts: Optional[ResourceOptions] = None,
definition: Optional[str] = None,
scope_id: Optional[str] = None,
scope_type: Optional[str] = None,
name: Optional[str] = None)func NewWorkflowAutomation(ctx *Context, name string, args WorkflowAutomationArgs, opts ...ResourceOption) (*WorkflowAutomation, error)public WorkflowAutomation(string name, WorkflowAutomationArgs args, CustomResourceOptions? opts = null)
public WorkflowAutomation(String name, WorkflowAutomationArgs args)
public WorkflowAutomation(String name, WorkflowAutomationArgs args, CustomResourceOptions options)
type: newrelic:WorkflowAutomation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "newrelic_workflowautomation" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args WorkflowAutomationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args WorkflowAutomationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args WorkflowAutomationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkflowAutomationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkflowAutomationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var workflowAutomationResource = new NewRelic.WorkflowAutomation("workflowAutomationResource", new()
{
Definition = "string",
ScopeId = "string",
ScopeType = "string",
Name = "string",
});
example, err := newrelic.NewWorkflowAutomation(ctx, "workflowAutomationResource", &newrelic.WorkflowAutomationArgs{
Definition: pulumi.String("string"),
ScopeId: pulumi.String("string"),
ScopeType: pulumi.String("string"),
Name: pulumi.String("string"),
})
resource "newrelic_workflowautomation" "workflowAutomationResource" {
definition = "string"
scope_id = "string"
scope_type = "string"
name = "string"
}
var workflowAutomationResource = new WorkflowAutomation("workflowAutomationResource", WorkflowAutomationArgs.builder()
.definition("string")
.scopeId("string")
.scopeType("string")
.name("string")
.build());
workflow_automation_resource = newrelic.WorkflowAutomation("workflowAutomationResource",
definition="string",
scope_id="string",
scope_type="string",
name="string")
const workflowAutomationResource = new newrelic.WorkflowAutomation("workflowAutomationResource", {
definition: "string",
scopeId: "string",
scopeType: "string",
name: "string",
});
type: newrelic:WorkflowAutomation
properties:
definition: string
name: string
scopeId: string
scopeType: string
WorkflowAutomation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The WorkflowAutomation resource accepts the following input properties:
- Definition string
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- Scope
Id string - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - Scope
Type string - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - Name string
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created.
- Definition string
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- Scope
Id string - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - Scope
Type string - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - Name string
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created.
- definition string
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- scope_
id string - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - scope_
type string - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - name string
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created.
- definition String
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- scope
Id String - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - scope
Type String - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - name String
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created.
- definition string
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- scope
Id string - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - scope
Type string - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - name string
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created.
- definition str
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- scope_
id str - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - scope_
type str - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - name str
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created.
- definition String
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- scope
Id String - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - scope
Type String - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - name String
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the WorkflowAutomation resource produces the following output properties:
- Definition
Id string - The ID of the workflow automation.
- Description string
- - The description of the workflow, as defined in the YAML.
- Id string
- The provider-assigned unique ID for this managed resource.
- Version int
- - The current version number of the workflow. This number increments with each update to the
definition. - Yaml string
- The yaml of the workflow automation.
- Definition
Id string - The ID of the workflow automation.
- Description string
- - The description of the workflow, as defined in the YAML.
- Id string
- The provider-assigned unique ID for this managed resource.
- Version int
- - The current version number of the workflow. This number increments with each update to the
definition. - Yaml string
- The yaml of the workflow automation.
- definition_
id string - The ID of the workflow automation.
- description string
- - The description of the workflow, as defined in the YAML.
- id string
- The provider-assigned unique ID for this managed resource.
- version number
- - The current version number of the workflow. This number increments with each update to the
definition. - yaml string
- The yaml of the workflow automation.
- definition
Id String - The ID of the workflow automation.
- description String
- - The description of the workflow, as defined in the YAML.
- id String
- The provider-assigned unique ID for this managed resource.
- version Integer
- - The current version number of the workflow. This number increments with each update to the
definition. - yaml String
- The yaml of the workflow automation.
- definition
Id string - The ID of the workflow automation.
- description string
- - The description of the workflow, as defined in the YAML.
- id string
- The provider-assigned unique ID for this managed resource.
- version number
- - The current version number of the workflow. This number increments with each update to the
definition. - yaml string
- The yaml of the workflow automation.
- definition_
id str - The ID of the workflow automation.
- description str
- - The description of the workflow, as defined in the YAML.
- id str
- The provider-assigned unique ID for this managed resource.
- version int
- - The current version number of the workflow. This number increments with each update to the
definition. - yaml str
- The yaml of the workflow automation.
- definition
Id String - The ID of the workflow automation.
- description String
- - The description of the workflow, as defined in the YAML.
- id String
- The provider-assigned unique ID for this managed resource.
- version Number
- - The current version number of the workflow. This number increments with each update to the
definition. - yaml String
- The yaml of the workflow automation.
Look up Existing WorkflowAutomation Resource
Get an existing WorkflowAutomation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: WorkflowAutomationState, opts?: CustomResourceOptions): WorkflowAutomation@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
definition: Optional[str] = None,
definition_id: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
scope_id: Optional[str] = None,
scope_type: Optional[str] = None,
version: Optional[int] = None,
yaml: Optional[str] = None) -> WorkflowAutomationfunc GetWorkflowAutomation(ctx *Context, name string, id IDInput, state *WorkflowAutomationState, opts ...ResourceOption) (*WorkflowAutomation, error)public static WorkflowAutomation Get(string name, Input<string> id, WorkflowAutomationState? state, CustomResourceOptions? opts = null)public static WorkflowAutomation get(String name, Output<String> id, WorkflowAutomationState state, CustomResourceOptions options)resources: _: type: newrelic:WorkflowAutomation get: id: ${id}import {
to = newrelic_workflowautomation.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Definition string
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- Definition
Id string - The ID of the workflow automation.
- Description string
- - The description of the workflow, as defined in the YAML.
- Name string
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created. - Scope
Id string - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - Scope
Type string - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - Version int
- - The current version number of the workflow. This number increments with each update to the
definition. - Yaml string
- The yaml of the workflow automation.
- Definition string
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- Definition
Id string - The ID of the workflow automation.
- Description string
- - The description of the workflow, as defined in the YAML.
- Name string
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created. - Scope
Id string - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - Scope
Type string - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - Version int
- - The current version number of the workflow. This number increments with each update to the
definition. - Yaml string
- The yaml of the workflow automation.
- definition string
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- definition_
id string - The ID of the workflow automation.
- description string
- - The description of the workflow, as defined in the YAML.
- name string
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created. - scope_
id string - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - scope_
type string - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - version number
- - The current version number of the workflow. This number increments with each update to the
definition. - yaml string
- The yaml of the workflow automation.
- definition String
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- definition
Id String - The ID of the workflow automation.
- description String
- - The description of the workflow, as defined in the YAML.
- name String
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created. - scope
Id String - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - scope
Type String - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - version Integer
- - The current version number of the workflow. This number increments with each update to the
definition. - yaml String
- The yaml of the workflow automation.
- definition string
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- definition
Id string - The ID of the workflow automation.
- description string
- - The description of the workflow, as defined in the YAML.
- name string
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created. - scope
Id string - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - scope
Type string - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - version number
- - The current version number of the workflow. This number increments with each update to the
definition. - yaml string
- The yaml of the workflow automation.
- definition str
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- definition_
id str - The ID of the workflow automation.
- description str
- - The description of the workflow, as defined in the YAML.
- name str
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created. - scope_
id str - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - scope_
type str - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - version int
- - The current version number of the workflow. This number increments with each update to the
definition. - yaml str
- The yaml of the workflow automation.
- definition String
- - (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
- definition
Id String - The ID of the workflow automation.
- description String
- - The description of the workflow, as defined in the YAML.
- name String
- - (Required) The name of the workflow. This must match the
namefield in the YAMLdefinition. Important: Changing this field will force a new resource to be created. - scope
Id String - - (Required) The ID of the scope for the workflow. For
ACCOUNTscope, this is your New Relic account ID (numeric). ForORGANIZATIONscope, this is your organization ID (string). Important: Changing this field will force a new resource to be created. - scope
Type String - - (Required) The scope type for the workflow. Must be either
ACCOUNTorORGANIZATION. Important: Changing this field will force a new resource to be created. - version Number
- - The current version number of the workflow. This number increments with each update to the
definition. - yaml String
- The yaml of the workflow automation.
Import
ant note
Name Consistency
The name field in the Terraform resource must match the name field in the YAML definition. If they don’t match, Terraform will return an error during terraform validate, plan, or apply.
Example Error Message:
Error: name in resource configuration (my-workflow) does not match name in YAML definition (my-new-workflow). The name field in your YAML must match the resource name
For example, this configuration is correct:
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const example = new newrelic.WorkflowAutomation("example", {
name: "my-workflow",
scopeId: "1234567",
scopeType: "ACCOUNT",
definition: `name: my-workflow # This matches the resource name
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
`,
});
import pulumi
import pulumi_newrelic as newrelic
example = newrelic.WorkflowAutomation("example",
name="my-workflow",
scope_id="1234567",
scope_type="ACCOUNT",
definition="""name: my-workflow # This matches the resource name
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
""")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var example = new NewRelic.WorkflowAutomation("example", new()
{
Name = "my-workflow",
ScopeId = "1234567",
ScopeType = "ACCOUNT",
Definition = @"name: my-workflow # This matches the resource name
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
",
});
});
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := newrelic.NewWorkflowAutomation(ctx, "example", &newrelic.WorkflowAutomationArgs{
Name: pulumi.String("my-workflow"),
ScopeId: pulumi.String("1234567"),
ScopeType: pulumi.String("ACCOUNT"),
Definition: pulumi.String(`name: my-workflow # This matches the resource name
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
`),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
newrelic = {
source = "pulumi/newrelic"
}
}
}
resource "newrelic_workflowautomation" "example" {
name = "my-workflow"
scope_id = "1234567"
scope_type = "ACCOUNT"
definition = "name: my-workflow # This matches the resource name\ndescription: Example workflow\nsteps:\n - name: waitStep\n type: wait\n seconds: 10\n"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.WorkflowAutomation;
import com.pulumi.newrelic.WorkflowAutomationArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new WorkflowAutomation("example", WorkflowAutomationArgs.builder()
.name("my-workflow")
.scopeId("1234567")
.scopeType("ACCOUNT")
.definition("""
name: my-workflow # This matches the resource name
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
""")
.build());
}
}
resources:
example:
type: newrelic:WorkflowAutomation
properties:
name: my-workflow
scopeId: '1234567'
scopeType: ACCOUNT
definition: |
name: my-workflow # This matches the resource name
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
This configuration is incorrect and will fail:
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const example = new newrelic.WorkflowAutomation("example", {
name: "my-workflow",
scopeId: "1234567",
scopeType: "ACCOUNT",
definition: `name: different-name # This doesn't match the resource name - ERROR!
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
`,
});
import pulumi
import pulumi_newrelic as newrelic
example = newrelic.WorkflowAutomation("example",
name="my-workflow",
scope_id="1234567",
scope_type="ACCOUNT",
definition="""name: different-name # This doesn't match the resource name - ERROR!
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
""")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var example = new NewRelic.WorkflowAutomation("example", new()
{
Name = "my-workflow",
ScopeId = "1234567",
ScopeType = "ACCOUNT",
Definition = @"name: different-name # This doesn't match the resource name - ERROR!
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
",
});
});
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := newrelic.NewWorkflowAutomation(ctx, "example", &newrelic.WorkflowAutomationArgs{
Name: pulumi.String("my-workflow"),
ScopeId: pulumi.String("1234567"),
ScopeType: pulumi.String("ACCOUNT"),
Definition: pulumi.String(`name: different-name # This doesn't match the resource name - ERROR!
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
`),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
newrelic = {
source = "pulumi/newrelic"
}
}
}
resource "newrelic_workflowautomation" "example" {
name = "my-workflow"
scope_id = "1234567"
scope_type = "ACCOUNT"
definition = "name: different-name # This doesn't match the resource name - ERROR!\ndescription: Example workflow\nsteps:\n - name: waitStep\n type: wait\n seconds: 10\n"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.WorkflowAutomation;
import com.pulumi.newrelic.WorkflowAutomationArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new WorkflowAutomation("example", WorkflowAutomationArgs.builder()
.name("my-workflow")
.scopeId("1234567")
.scopeType("ACCOUNT")
.definition("""
name: different-name # This doesn't match the resource name - ERROR!
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
""")
.build());
}
}
resources:
example:
type: newrelic:WorkflowAutomation
properties:
name: my-workflow
scopeId: '1234567'
scopeType: ACCOUNT
definition: |
name: different-name # This doesn't match the resource name - ERROR!
description: Example workflow
steps:
- name: waitStep
type: wait
seconds: 10
Scope type
- ACCOUNT - The workflow automation is scoped to a specific New Relic account. Use your numeric account ID as the
scopeId. - ORGANIZATION - The workflow automation is scoped to your entire New Relic organization. Use your organization ID string as the
scopeId.
See, Create accounts and organizations on how to create an account or an organization.
ForceNew attributes
The following attributes, when changed, will force creation of a new resource :
name- Changing the workflow name creates a new resource.scopeId- Changing the scope ID creates a new resource.scopeType- Changing between ACCOUNT and ORGANIZATION creates a new resource.
YAML validation
The provider validates the YAML definition during plan-and-apply operations:
- The YAML must be valid and parsable.
- The
namefield must be present in the YAML. - The
namein the YAML must match the Terraform resource name.
Invalid YAML or missing required fields will result in an error.
Example YAML validation errors:
YAML Validation Error
waitStep has invalid type “waitAgain”. Valid types are: action, loop, switch, wait, assign
Workflow definition names can not be changed.
Versioning
Each time you update the definition of a workflow automation, New Relic automatically increments the version attribute. This allows you to track changes to your workflow automation over time.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
newrelicTerraform Provider.
published on Tuesday, Jun 23, 2026 by Pulumi