1. Packages
  2. New Relic
  3. API Docs
  4. Workflow
New Relic v5.36.1 published on Tuesday, Nov 12, 2024 by Pulumi

newrelic.Workflow

Explore with Pulumi AI

newrelic logo
New Relic v5.36.1 published on Tuesday, Nov 12, 2024 by Pulumi

    Use this resource to create and manage New Relic workflows.

    Example Usage

    Workflow
    import * as pulumi from "@pulumi/pulumi";
    import * as newrelic from "@pulumi/newrelic";
    
    const foo = new newrelic.Workflow("foo", {
        name: "workflow-example",
        mutingRulesHandling: "NOTIFY_ALL_ISSUES",
        issuesFilter: {
            name: "filter-name",
            type: "FILTER",
            predicates: [{
                attribute: "accumulations.tag.team",
                operator: "EXACTLY_MATCHES",
                values: ["growth"],
            }],
        },
        destinations: [{
            channelId: someChannel.id,
        }],
    });
    
    import pulumi
    import pulumi_newrelic as newrelic
    
    foo = newrelic.Workflow("foo",
        name="workflow-example",
        muting_rules_handling="NOTIFY_ALL_ISSUES",
        issues_filter={
            "name": "filter-name",
            "type": "FILTER",
            "predicates": [{
                "attribute": "accumulations.tag.team",
                "operator": "EXACTLY_MATCHES",
                "values": ["growth"],
            }],
        },
        destinations=[{
            "channel_id": some_channel["id"],
        }])
    
    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.NewWorkflow(ctx, "foo", &newrelic.WorkflowArgs{
    			Name:                pulumi.String("workflow-example"),
    			MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
    			IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
    				Name: pulumi.String("filter-name"),
    				Type: pulumi.String("FILTER"),
    				Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
    					&newrelic.WorkflowIssuesFilterPredicateArgs{
    						Attribute: pulumi.String("accumulations.tag.team"),
    						Operator:  pulumi.String("EXACTLY_MATCHES"),
    						Values: pulumi.StringArray{
    							pulumi.String("growth"),
    						},
    					},
    				},
    			},
    			Destinations: newrelic.WorkflowDestinationArray{
    				&newrelic.WorkflowDestinationArgs{
    					ChannelId: pulumi.Any(someChannel.Id),
    				},
    			},
    		})
    		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 foo = new NewRelic.Workflow("foo", new()
        {
            Name = "workflow-example",
            MutingRulesHandling = "NOTIFY_ALL_ISSUES",
            IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
            {
                Name = "filter-name",
                Type = "FILTER",
                Predicates = new[]
                {
                    new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
                    {
                        Attribute = "accumulations.tag.team",
                        Operator = "EXACTLY_MATCHES",
                        Values = new[]
                        {
                            "growth",
                        },
                    },
                },
            },
            Destinations = new[]
            {
                new NewRelic.Inputs.WorkflowDestinationArgs
                {
                    ChannelId = someChannel.Id,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.newrelic.Workflow;
    import com.pulumi.newrelic.WorkflowArgs;
    import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
    import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
    import java.util.List;
    import java.util.ArrayList;
    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 foo = new Workflow("foo", WorkflowArgs.builder()
                .name("workflow-example")
                .mutingRulesHandling("NOTIFY_ALL_ISSUES")
                .issuesFilter(WorkflowIssuesFilterArgs.builder()
                    .name("filter-name")
                    .type("FILTER")
                    .predicates(WorkflowIssuesFilterPredicateArgs.builder()
                        .attribute("accumulations.tag.team")
                        .operator("EXACTLY_MATCHES")
                        .values("growth")
                        .build())
                    .build())
                .destinations(WorkflowDestinationArgs.builder()
                    .channelId(someChannel.id())
                    .build())
                .build());
    
        }
    }
    
    resources:
      foo:
        type: newrelic:Workflow
        properties:
          name: workflow-example
          mutingRulesHandling: NOTIFY_ALL_ISSUES
          issuesFilter:
            name: filter-name
            type: FILTER
            predicates:
              - attribute: accumulations.tag.team
                operator: EXACTLY_MATCHES
                values:
                  - growth
          destinations:
            - channelId: ${someChannel.id}
    

    Policy-Based Workflow Example

    This scenario describes one of most common ways of using workflows by defining a set of policies the workflow handles

    import * as pulumi from "@pulumi/pulumi";
    import * as newrelic from "@pulumi/newrelic";
    
    // Create a policy to track
    const my_policy = new newrelic.AlertPolicy("my-policy", {name: "my_policy"});
    // Create a reusable notification destination
    const webhook_destination = new newrelic.NotificationDestination("webhook-destination", {
        name: "destination-webhook",
        type: "WEBHOOK",
        properties: [{
            key: "url",
            value: "https://example.com",
        }],
        authBasic: {
            user: "username",
            password: "password",
        },
    });
    // Create a notification channel to use in the workflow
    const webhook_channel = new newrelic.NotificationChannel("webhook-channel", {
        name: "channel-webhook",
        type: "WEBHOOK",
        destinationId: webhook_destination.id,
        product: "IINT",
        properties: [{
            key: "payload",
            value: "{}",
            label: "Payload Template",
        }],
    });
    // A workflow that matches issues that include incidents triggered by the policy
    const workflow_example = new newrelic.Workflow("workflow-example", {
        name: "workflow-example",
        mutingRulesHandling: "NOTIFY_ALL_ISSUES",
        issuesFilter: {
            name: "Filter-name",
            type: "FILTER",
            predicates: [{
                attribute: "labels.policyIds",
                operator: "EXACTLY_MATCHES",
                values: [my_policy.id],
            }],
        },
        destinations: [{
            channelId: webhook_channel.id,
        }],
    });
    
    import pulumi
    import pulumi_newrelic as newrelic
    
    # Create a policy to track
    my_policy = newrelic.AlertPolicy("my-policy", name="my_policy")
    # Create a reusable notification destination
    webhook_destination = newrelic.NotificationDestination("webhook-destination",
        name="destination-webhook",
        type="WEBHOOK",
        properties=[{
            "key": "url",
            "value": "https://example.com",
        }],
        auth_basic={
            "user": "username",
            "password": "password",
        })
    # Create a notification channel to use in the workflow
    webhook_channel = newrelic.NotificationChannel("webhook-channel",
        name="channel-webhook",
        type="WEBHOOK",
        destination_id=webhook_destination.id,
        product="IINT",
        properties=[{
            "key": "payload",
            "value": "{}",
            "label": "Payload Template",
        }])
    # A workflow that matches issues that include incidents triggered by the policy
    workflow_example = newrelic.Workflow("workflow-example",
        name="workflow-example",
        muting_rules_handling="NOTIFY_ALL_ISSUES",
        issues_filter={
            "name": "Filter-name",
            "type": "FILTER",
            "predicates": [{
                "attribute": "labels.policyIds",
                "operator": "EXACTLY_MATCHES",
                "values": [my_policy.id],
            }],
        },
        destinations=[{
            "channel_id": webhook_channel.id,
        }])
    
    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 {
    		// Create a policy to track
    		_, err := newrelic.NewAlertPolicy(ctx, "my-policy", &newrelic.AlertPolicyArgs{
    			Name: pulumi.String("my_policy"),
    		})
    		if err != nil {
    			return err
    		}
    		// Create a reusable notification destination
    		_, err = newrelic.NewNotificationDestination(ctx, "webhook-destination", &newrelic.NotificationDestinationArgs{
    			Name: pulumi.String("destination-webhook"),
    			Type: pulumi.String("WEBHOOK"),
    			Properties: newrelic.NotificationDestinationPropertyArray{
    				&newrelic.NotificationDestinationPropertyArgs{
    					Key:   pulumi.String("url"),
    					Value: pulumi.String("https://example.com"),
    				},
    			},
    			AuthBasic: &newrelic.NotificationDestinationAuthBasicArgs{
    				User:     pulumi.String("username"),
    				Password: pulumi.String("password"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Create a notification channel to use in the workflow
    		_, err = newrelic.NewNotificationChannel(ctx, "webhook-channel", &newrelic.NotificationChannelArgs{
    			Name:          pulumi.String("channel-webhook"),
    			Type:          pulumi.String("WEBHOOK"),
    			DestinationId: webhook_destination.ID(),
    			Product:       pulumi.String("IINT"),
    			Properties: newrelic.NotificationChannelPropertyArray{
    				&newrelic.NotificationChannelPropertyArgs{
    					Key:   pulumi.String("payload"),
    					Value: pulumi.String("{}"),
    					Label: pulumi.String("Payload Template"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// A workflow that matches issues that include incidents triggered by the policy
    		_, err = newrelic.NewWorkflow(ctx, "workflow-example", &newrelic.WorkflowArgs{
    			Name:                pulumi.String("workflow-example"),
    			MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
    			IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
    				Name: pulumi.String("Filter-name"),
    				Type: pulumi.String("FILTER"),
    				Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
    					&newrelic.WorkflowIssuesFilterPredicateArgs{
    						Attribute: pulumi.String("labels.policyIds"),
    						Operator:  pulumi.String("EXACTLY_MATCHES"),
    						Values: pulumi.StringArray{
    							my_policy.ID(),
    						},
    					},
    				},
    			},
    			Destinations: newrelic.WorkflowDestinationArray{
    				&newrelic.WorkflowDestinationArgs{
    					ChannelId: webhook_channel.ID(),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using NewRelic = Pulumi.NewRelic;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a policy to track
        var my_policy = new NewRelic.AlertPolicy("my-policy", new()
        {
            Name = "my_policy",
        });
    
        // Create a reusable notification destination
        var webhook_destination = new NewRelic.NotificationDestination("webhook-destination", new()
        {
            Name = "destination-webhook",
            Type = "WEBHOOK",
            Properties = new[]
            {
                new NewRelic.Inputs.NotificationDestinationPropertyArgs
                {
                    Key = "url",
                    Value = "https://example.com",
                },
            },
            AuthBasic = new NewRelic.Inputs.NotificationDestinationAuthBasicArgs
            {
                User = "username",
                Password = "password",
            },
        });
    
        // Create a notification channel to use in the workflow
        var webhook_channel = new NewRelic.NotificationChannel("webhook-channel", new()
        {
            Name = "channel-webhook",
            Type = "WEBHOOK",
            DestinationId = webhook_destination.Id,
            Product = "IINT",
            Properties = new[]
            {
                new NewRelic.Inputs.NotificationChannelPropertyArgs
                {
                    Key = "payload",
                    Value = "{}",
                    Label = "Payload Template",
                },
            },
        });
    
        // A workflow that matches issues that include incidents triggered by the policy
        var workflow_example = new NewRelic.Workflow("workflow-example", new()
        {
            Name = "workflow-example",
            MutingRulesHandling = "NOTIFY_ALL_ISSUES",
            IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
            {
                Name = "Filter-name",
                Type = "FILTER",
                Predicates = new[]
                {
                    new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
                    {
                        Attribute = "labels.policyIds",
                        Operator = "EXACTLY_MATCHES",
                        Values = new[]
                        {
                            my_policy.Id,
                        },
                    },
                },
            },
            Destinations = new[]
            {
                new NewRelic.Inputs.WorkflowDestinationArgs
                {
                    ChannelId = webhook_channel.Id,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.newrelic.AlertPolicy;
    import com.pulumi.newrelic.AlertPolicyArgs;
    import com.pulumi.newrelic.NotificationDestination;
    import com.pulumi.newrelic.NotificationDestinationArgs;
    import com.pulumi.newrelic.inputs.NotificationDestinationPropertyArgs;
    import com.pulumi.newrelic.inputs.NotificationDestinationAuthBasicArgs;
    import com.pulumi.newrelic.NotificationChannel;
    import com.pulumi.newrelic.NotificationChannelArgs;
    import com.pulumi.newrelic.inputs.NotificationChannelPropertyArgs;
    import com.pulumi.newrelic.Workflow;
    import com.pulumi.newrelic.WorkflowArgs;
    import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
    import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
    import java.util.List;
    import java.util.ArrayList;
    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) {
            // Create a policy to track
            var my_policy = new AlertPolicy("my-policy", AlertPolicyArgs.builder()
                .name("my_policy")
                .build());
    
            // Create a reusable notification destination
            var webhook_destination = new NotificationDestination("webhook-destination", NotificationDestinationArgs.builder()
                .name("destination-webhook")
                .type("WEBHOOK")
                .properties(NotificationDestinationPropertyArgs.builder()
                    .key("url")
                    .value("https://example.com")
                    .build())
                .authBasic(NotificationDestinationAuthBasicArgs.builder()
                    .user("username")
                    .password("password")
                    .build())
                .build());
    
            // Create a notification channel to use in the workflow
            var webhook_channel = new NotificationChannel("webhook-channel", NotificationChannelArgs.builder()
                .name("channel-webhook")
                .type("WEBHOOK")
                .destinationId(webhook_destination.id())
                .product("IINT")
                .properties(NotificationChannelPropertyArgs.builder()
                    .key("payload")
                    .value("{}")
                    .label("Payload Template")
                    .build())
                .build());
    
            // A workflow that matches issues that include incidents triggered by the policy
            var workflow_example = new Workflow("workflow-example", WorkflowArgs.builder()
                .name("workflow-example")
                .mutingRulesHandling("NOTIFY_ALL_ISSUES")
                .issuesFilter(WorkflowIssuesFilterArgs.builder()
                    .name("Filter-name")
                    .type("FILTER")
                    .predicates(WorkflowIssuesFilterPredicateArgs.builder()
                        .attribute("labels.policyIds")
                        .operator("EXACTLY_MATCHES")
                        .values(my_policy.id())
                        .build())
                    .build())
                .destinations(WorkflowDestinationArgs.builder()
                    .channelId(webhook_channel.id())
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Create a policy to track
      my-policy:
        type: newrelic:AlertPolicy
        properties:
          name: my_policy
      # Create a reusable notification destination
      webhook-destination:
        type: newrelic:NotificationDestination
        properties:
          name: destination-webhook
          type: WEBHOOK
          properties:
            - key: url
              value: https://example.com
          authBasic:
            user: username
            password: password
      # Create a notification channel to use in the workflow
      webhook-channel:
        type: newrelic:NotificationChannel
        properties:
          name: channel-webhook
          type: WEBHOOK
          destinationId: ${["webhook-destination"].id}
          product: IINT
          properties:
            - key: payload
              value: '{}'
              label: Payload Template
      # A workflow that matches issues that include incidents triggered by the policy
      workflow-example:
        type: newrelic:Workflow
        properties:
          name: workflow-example
          mutingRulesHandling: NOTIFY_ALL_ISSUES
          issuesFilter:
            name: Filter-name
            type: FILTER
            predicates:
              - attribute: labels.policyIds
                operator: EXACTLY_MATCHES
                values:
                  - ${["my-policy"].id}
          destinations:
            - channelId: ${["webhook-channel"].id}
    

    An example of a workflow with enrichments

    import * as pulumi from "@pulumi/pulumi";
    import * as newrelic from "@pulumi/newrelic";
    
    const workflow_example = new newrelic.Workflow("workflow-example", {
        name: "workflow-enrichment-example",
        mutingRulesHandling: "NOTIFY_ALL_ISSUES",
        issuesFilter: {
            name: "Filter-name",
            type: "FILTER",
            predicates: [{
                attribute: "accumulations.tag.team",
                operator: "EXACTLY_MATCHES",
                values: ["my_team"],
            }],
        },
        enrichments: {
            nrqls: [{
                name: "Log Count",
                configurations: [{
                    query: "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
                }],
            }],
        },
        destinations: [{
            channelId: webhook_channel.id,
        }],
    });
    
    import pulumi
    import pulumi_newrelic as newrelic
    
    workflow_example = newrelic.Workflow("workflow-example",
        name="workflow-enrichment-example",
        muting_rules_handling="NOTIFY_ALL_ISSUES",
        issues_filter={
            "name": "Filter-name",
            "type": "FILTER",
            "predicates": [{
                "attribute": "accumulations.tag.team",
                "operator": "EXACTLY_MATCHES",
                "values": ["my_team"],
            }],
        },
        enrichments={
            "nrqls": [{
                "name": "Log Count",
                "configurations": [{
                    "query": "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
                }],
            }],
        },
        destinations=[{
            "channel_id": webhook_channel["id"],
        }])
    
    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.NewWorkflow(ctx, "workflow-example", &newrelic.WorkflowArgs{
    			Name:                pulumi.String("workflow-enrichment-example"),
    			MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
    			IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
    				Name: pulumi.String("Filter-name"),
    				Type: pulumi.String("FILTER"),
    				Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
    					&newrelic.WorkflowIssuesFilterPredicateArgs{
    						Attribute: pulumi.String("accumulations.tag.team"),
    						Operator:  pulumi.String("EXACTLY_MATCHES"),
    						Values: pulumi.StringArray{
    							pulumi.String("my_team"),
    						},
    					},
    				},
    			},
    			Enrichments: &newrelic.WorkflowEnrichmentsArgs{
    				Nrqls: newrelic.WorkflowEnrichmentsNrqlArray{
    					&newrelic.WorkflowEnrichmentsNrqlArgs{
    						Name: pulumi.String("Log Count"),
    						Configurations: newrelic.WorkflowEnrichmentsNrqlConfigurationArray{
    							&newrelic.WorkflowEnrichmentsNrqlConfigurationArgs{
    								Query: pulumi.String("SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago"),
    							},
    						},
    					},
    				},
    			},
    			Destinations: newrelic.WorkflowDestinationArray{
    				&newrelic.WorkflowDestinationArgs{
    					ChannelId: pulumi.Any(webhook_channel.Id),
    				},
    			},
    		})
    		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 workflow_example = new NewRelic.Workflow("workflow-example", new()
        {
            Name = "workflow-enrichment-example",
            MutingRulesHandling = "NOTIFY_ALL_ISSUES",
            IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
            {
                Name = "Filter-name",
                Type = "FILTER",
                Predicates = new[]
                {
                    new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
                    {
                        Attribute = "accumulations.tag.team",
                        Operator = "EXACTLY_MATCHES",
                        Values = new[]
                        {
                            "my_team",
                        },
                    },
                },
            },
            Enrichments = new NewRelic.Inputs.WorkflowEnrichmentsArgs
            {
                Nrqls = new[]
                {
                    new NewRelic.Inputs.WorkflowEnrichmentsNrqlArgs
                    {
                        Name = "Log Count",
                        Configurations = new[]
                        {
                            new NewRelic.Inputs.WorkflowEnrichmentsNrqlConfigurationArgs
                            {
                                Query = "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
                            },
                        },
                    },
                },
            },
            Destinations = new[]
            {
                new NewRelic.Inputs.WorkflowDestinationArgs
                {
                    ChannelId = webhook_channel.Id,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.newrelic.Workflow;
    import com.pulumi.newrelic.WorkflowArgs;
    import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
    import com.pulumi.newrelic.inputs.WorkflowEnrichmentsArgs;
    import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
    import java.util.List;
    import java.util.ArrayList;
    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 workflow_example = new Workflow("workflow-example", WorkflowArgs.builder()
                .name("workflow-enrichment-example")
                .mutingRulesHandling("NOTIFY_ALL_ISSUES")
                .issuesFilter(WorkflowIssuesFilterArgs.builder()
                    .name("Filter-name")
                    .type("FILTER")
                    .predicates(WorkflowIssuesFilterPredicateArgs.builder()
                        .attribute("accumulations.tag.team")
                        .operator("EXACTLY_MATCHES")
                        .values("my_team")
                        .build())
                    .build())
                .enrichments(WorkflowEnrichmentsArgs.builder()
                    .nrqls(WorkflowEnrichmentsNrqlArgs.builder()
                        .name("Log Count")
                        .configurations(WorkflowEnrichmentsNrqlConfigurationArgs.builder()
                            .query("SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago")
                            .build())
                        .build())
                    .build())
                .destinations(WorkflowDestinationArgs.builder()
                    .channelId(webhook_channel.id())
                    .build())
                .build());
    
        }
    }
    
    resources:
      workflow-example:
        type: newrelic:Workflow
        properties:
          name: workflow-enrichment-example
          mutingRulesHandling: NOTIFY_ALL_ISSUES
          issuesFilter:
            name: Filter-name
            type: FILTER
            predicates:
              - attribute: accumulations.tag.team
                operator: EXACTLY_MATCHES
                values:
                  - my_team
          enrichments:
            nrqls:
              - name: Log Count
                configurations:
                  - query: SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago
          destinations:
            - channelId: ${["webhook-channel"].id}
    

    An example of a workflow with notification triggers

    import * as pulumi from "@pulumi/pulumi";
    import * as newrelic from "@pulumi/newrelic";
    
    const workflow_example = new newrelic.Workflow("workflow-example", {
        name: "workflow-enrichment-example",
        mutingRulesHandling: "NOTIFY_ALL_ISSUES",
        issuesFilter: {
            name: "Filter-name",
            type: "FILTER",
            predicates: [{
                attribute: "accumulations.tag.team",
                operator: "EXACTLY_MATCHES",
                values: ["my_team"],
            }],
        },
        destinations: [{
            channelId: webhook_channel.id,
            notificationTriggers: ["ACTIVATED"],
        }],
    });
    
    import pulumi
    import pulumi_newrelic as newrelic
    
    workflow_example = newrelic.Workflow("workflow-example",
        name="workflow-enrichment-example",
        muting_rules_handling="NOTIFY_ALL_ISSUES",
        issues_filter={
            "name": "Filter-name",
            "type": "FILTER",
            "predicates": [{
                "attribute": "accumulations.tag.team",
                "operator": "EXACTLY_MATCHES",
                "values": ["my_team"],
            }],
        },
        destinations=[{
            "channel_id": webhook_channel["id"],
            "notification_triggers": ["ACTIVATED"],
        }])
    
    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.NewWorkflow(ctx, "workflow-example", &newrelic.WorkflowArgs{
    			Name:                pulumi.String("workflow-enrichment-example"),
    			MutingRulesHandling: pulumi.String("NOTIFY_ALL_ISSUES"),
    			IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
    				Name: pulumi.String("Filter-name"),
    				Type: pulumi.String("FILTER"),
    				Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
    					&newrelic.WorkflowIssuesFilterPredicateArgs{
    						Attribute: pulumi.String("accumulations.tag.team"),
    						Operator:  pulumi.String("EXACTLY_MATCHES"),
    						Values: pulumi.StringArray{
    							pulumi.String("my_team"),
    						},
    					},
    				},
    			},
    			Destinations: newrelic.WorkflowDestinationArray{
    				&newrelic.WorkflowDestinationArgs{
    					ChannelId: pulumi.Any(webhook_channel.Id),
    					NotificationTriggers: pulumi.StringArray{
    						pulumi.String("ACTIVATED"),
    					},
    				},
    			},
    		})
    		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 workflow_example = new NewRelic.Workflow("workflow-example", new()
        {
            Name = "workflow-enrichment-example",
            MutingRulesHandling = "NOTIFY_ALL_ISSUES",
            IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
            {
                Name = "Filter-name",
                Type = "FILTER",
                Predicates = new[]
                {
                    new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
                    {
                        Attribute = "accumulations.tag.team",
                        Operator = "EXACTLY_MATCHES",
                        Values = new[]
                        {
                            "my_team",
                        },
                    },
                },
            },
            Destinations = new[]
            {
                new NewRelic.Inputs.WorkflowDestinationArgs
                {
                    ChannelId = webhook_channel.Id,
                    NotificationTriggers = new[]
                    {
                        "ACTIVATED",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.newrelic.Workflow;
    import com.pulumi.newrelic.WorkflowArgs;
    import com.pulumi.newrelic.inputs.WorkflowIssuesFilterArgs;
    import com.pulumi.newrelic.inputs.WorkflowDestinationArgs;
    import java.util.List;
    import java.util.ArrayList;
    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 workflow_example = new Workflow("workflow-example", WorkflowArgs.builder()
                .name("workflow-enrichment-example")
                .mutingRulesHandling("NOTIFY_ALL_ISSUES")
                .issuesFilter(WorkflowIssuesFilterArgs.builder()
                    .name("Filter-name")
                    .type("FILTER")
                    .predicates(WorkflowIssuesFilterPredicateArgs.builder()
                        .attribute("accumulations.tag.team")
                        .operator("EXACTLY_MATCHES")
                        .values("my_team")
                        .build())
                    .build())
                .destinations(WorkflowDestinationArgs.builder()
                    .channelId(webhook_channel.id())
                    .notificationTriggers("ACTIVATED")
                    .build())
                .build());
    
        }
    }
    
    resources:
      workflow-example:
        type: newrelic:Workflow
        properties:
          name: workflow-enrichment-example
          mutingRulesHandling: NOTIFY_ALL_ISSUES
          issuesFilter:
            name: Filter-name
            type: FILTER
            predicates:
              - attribute: accumulations.tag.team
                operator: EXACTLY_MATCHES
                values:
                  - my_team
          destinations:
            - channelId: ${["webhook-channel"].id}
              notificationTriggers:
                - ACTIVATED
    

    Additional Information

    More details about the workflows can be found here.

    Moving from Legacy Alert Policy Channels to Workflows

    As described in the documentation of this resource, mapping alert channels (created using newrelic.NotificationDestination and newrelic.NotificationChannel) to policies can be performed using the newrelic.Workflow resource, which is an alternative to the legacy resource newrelic.AlertPolicyChannel (which consumes alert channels created using the legacy resource newrelic.AlertChannel).

    Both of the legacy resources mentioned above, newrelic.AlertChannel and newrelic.AlertPolicyChannel are deprecated and will be removed in a future major release, as stated in the documentation of both of these resources.

    If you’re currently using newrelic.AlertChannel and newrelic.AlertPolicyChannel to manage alert channels linked to policies, we strongly recommend migrating to these workflows and notifications-based resources at the earliest.

    Please refer to the examples in this page, or this example for illustrations on setting up channels and workflows with these resources.

    v3.3 changes

    In version v3.3 we renamed the following arguments:

    • workflow_enabled changed to enabled.
    • destination_configuration changed to destination.
    • predicates changed to predicate.
    • Enrichment’s configurations changed to configuration.

    Create Workflow Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Workflow(name: string, args: WorkflowArgs, opts?: CustomResourceOptions);
    @overload
    def Workflow(resource_name: str,
                 args: WorkflowArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Workflow(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 destinations: Optional[Sequence[WorkflowDestinationArgs]] = None,
                 issues_filter: Optional[WorkflowIssuesFilterArgs] = None,
                 muting_rules_handling: Optional[str] = None,
                 account_id: Optional[str] = None,
                 destinations_enabled: Optional[bool] = None,
                 enabled: Optional[bool] = None,
                 enrichments: Optional[WorkflowEnrichmentsArgs] = None,
                 enrichments_enabled: Optional[bool] = None,
                 name: Optional[str] = None)
    func NewWorkflow(ctx *Context, name string, args WorkflowArgs, opts ...ResourceOption) (*Workflow, error)
    public Workflow(string name, WorkflowArgs args, CustomResourceOptions? opts = null)
    public Workflow(String name, WorkflowArgs args)
    public Workflow(String name, WorkflowArgs args, CustomResourceOptions options)
    
    type: newrelic:Workflow
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args WorkflowArgs
    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 WorkflowArgs
    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 WorkflowArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkflowArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkflowArgs
    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 workflowResource = new NewRelic.Workflow("workflowResource", new()
    {
        Destinations = new[]
        {
            new NewRelic.Inputs.WorkflowDestinationArgs
            {
                ChannelId = "string",
                Name = "string",
                NotificationTriggers = new[]
                {
                    "string",
                },
                Type = "string",
                UpdateOriginalMessage = false,
            },
        },
        IssuesFilter = new NewRelic.Inputs.WorkflowIssuesFilterArgs
        {
            Name = "string",
            Type = "string",
            FilterId = "string",
            Predicates = new[]
            {
                new NewRelic.Inputs.WorkflowIssuesFilterPredicateArgs
                {
                    Attribute = "string",
                    Operator = "string",
                    Values = new[]
                    {
                        "string",
                    },
                },
            },
        },
        MutingRulesHandling = "string",
        AccountId = "string",
        Enabled = false,
        Enrichments = new NewRelic.Inputs.WorkflowEnrichmentsArgs
        {
            Nrqls = new[]
            {
                new NewRelic.Inputs.WorkflowEnrichmentsNrqlArgs
                {
                    Configurations = new[]
                    {
                        new NewRelic.Inputs.WorkflowEnrichmentsNrqlConfigurationArgs
                        {
                            Query = "string",
                        },
                    },
                    Name = "string",
                    AccountId = "string",
                    EnrichmentId = "string",
                    Type = "string",
                },
            },
        },
        EnrichmentsEnabled = false,
        Name = "string",
    });
    
    example, err := newrelic.NewWorkflow(ctx, "workflowResource", &newrelic.WorkflowArgs{
    	Destinations: newrelic.WorkflowDestinationArray{
    		&newrelic.WorkflowDestinationArgs{
    			ChannelId: pulumi.String("string"),
    			Name:      pulumi.String("string"),
    			NotificationTriggers: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Type:                  pulumi.String("string"),
    			UpdateOriginalMessage: pulumi.Bool(false),
    		},
    	},
    	IssuesFilter: &newrelic.WorkflowIssuesFilterArgs{
    		Name:     pulumi.String("string"),
    		Type:     pulumi.String("string"),
    		FilterId: pulumi.String("string"),
    		Predicates: newrelic.WorkflowIssuesFilterPredicateArray{
    			&newrelic.WorkflowIssuesFilterPredicateArgs{
    				Attribute: pulumi.String("string"),
    				Operator:  pulumi.String("string"),
    				Values: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    			},
    		},
    	},
    	MutingRulesHandling: pulumi.String("string"),
    	AccountId:           pulumi.String("string"),
    	Enabled:             pulumi.Bool(false),
    	Enrichments: &newrelic.WorkflowEnrichmentsArgs{
    		Nrqls: newrelic.WorkflowEnrichmentsNrqlArray{
    			&newrelic.WorkflowEnrichmentsNrqlArgs{
    				Configurations: newrelic.WorkflowEnrichmentsNrqlConfigurationArray{
    					&newrelic.WorkflowEnrichmentsNrqlConfigurationArgs{
    						Query: pulumi.String("string"),
    					},
    				},
    				Name:         pulumi.String("string"),
    				AccountId:    pulumi.String("string"),
    				EnrichmentId: pulumi.String("string"),
    				Type:         pulumi.String("string"),
    			},
    		},
    	},
    	EnrichmentsEnabled: pulumi.Bool(false),
    	Name:               pulumi.String("string"),
    })
    
    var workflowResource = new Workflow("workflowResource", WorkflowArgs.builder()
        .destinations(WorkflowDestinationArgs.builder()
            .channelId("string")
            .name("string")
            .notificationTriggers("string")
            .type("string")
            .updateOriginalMessage(false)
            .build())
        .issuesFilter(WorkflowIssuesFilterArgs.builder()
            .name("string")
            .type("string")
            .filterId("string")
            .predicates(WorkflowIssuesFilterPredicateArgs.builder()
                .attribute("string")
                .operator("string")
                .values("string")
                .build())
            .build())
        .mutingRulesHandling("string")
        .accountId("string")
        .enabled(false)
        .enrichments(WorkflowEnrichmentsArgs.builder()
            .nrqls(WorkflowEnrichmentsNrqlArgs.builder()
                .configurations(WorkflowEnrichmentsNrqlConfigurationArgs.builder()
                    .query("string")
                    .build())
                .name("string")
                .accountId("string")
                .enrichmentId("string")
                .type("string")
                .build())
            .build())
        .enrichmentsEnabled(false)
        .name("string")
        .build());
    
    workflow_resource = newrelic.Workflow("workflowResource",
        destinations=[{
            "channel_id": "string",
            "name": "string",
            "notification_triggers": ["string"],
            "type": "string",
            "update_original_message": False,
        }],
        issues_filter={
            "name": "string",
            "type": "string",
            "filter_id": "string",
            "predicates": [{
                "attribute": "string",
                "operator": "string",
                "values": ["string"],
            }],
        },
        muting_rules_handling="string",
        account_id="string",
        enabled=False,
        enrichments={
            "nrqls": [{
                "configurations": [{
                    "query": "string",
                }],
                "name": "string",
                "account_id": "string",
                "enrichment_id": "string",
                "type": "string",
            }],
        },
        enrichments_enabled=False,
        name="string")
    
    const workflowResource = new newrelic.Workflow("workflowResource", {
        destinations: [{
            channelId: "string",
            name: "string",
            notificationTriggers: ["string"],
            type: "string",
            updateOriginalMessage: false,
        }],
        issuesFilter: {
            name: "string",
            type: "string",
            filterId: "string",
            predicates: [{
                attribute: "string",
                operator: "string",
                values: ["string"],
            }],
        },
        mutingRulesHandling: "string",
        accountId: "string",
        enabled: false,
        enrichments: {
            nrqls: [{
                configurations: [{
                    query: "string",
                }],
                name: "string",
                accountId: "string",
                enrichmentId: "string",
                type: "string",
            }],
        },
        enrichmentsEnabled: false,
        name: "string",
    });
    
    type: newrelic:Workflow
    properties:
        accountId: string
        destinations:
            - channelId: string
              name: string
              notificationTriggers:
                - string
              type: string
              updateOriginalMessage: false
        enabled: false
        enrichments:
            nrqls:
                - accountId: string
                  configurations:
                    - query: string
                  enrichmentId: string
                  name: string
                  type: string
        enrichmentsEnabled: false
        issuesFilter:
            filterId: string
            name: string
            predicates:
                - attribute: string
                  operator: string
                  values:
                    - string
            type: string
        mutingRulesHandling: string
        name: string
    

    Workflow 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 Workflow resource accepts the following input properties:

    Destinations List<Pulumi.NewRelic.Inputs.WorkflowDestination>
    Notification configuration. See Nested destination blocks below for details.
    IssuesFilter Pulumi.NewRelic.Inputs.WorkflowIssuesFilter
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    MutingRulesHandling string
    How to handle muted issues. See Muting Rules below for details.
    AccountId string
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    DestinationsEnabled bool
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    Enabled bool
    Whether workflow is enabled. Defaults to true.
    Enrichments Pulumi.NewRelic.Inputs.WorkflowEnrichments
    Workflow's enrichments. See Nested enrichments blocks below for details.
    EnrichmentsEnabled bool
    Whether enrichments are enabled. Defaults to true.
    Name string
    The name of the workflow.
    Destinations []WorkflowDestinationArgs
    Notification configuration. See Nested destination blocks below for details.
    IssuesFilter WorkflowIssuesFilterArgs
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    MutingRulesHandling string
    How to handle muted issues. See Muting Rules below for details.
    AccountId string
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    DestinationsEnabled bool
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    Enabled bool
    Whether workflow is enabled. Defaults to true.
    Enrichments WorkflowEnrichmentsArgs
    Workflow's enrichments. See Nested enrichments blocks below for details.
    EnrichmentsEnabled bool
    Whether enrichments are enabled. Defaults to true.
    Name string
    The name of the workflow.
    destinations List<WorkflowDestination>
    Notification configuration. See Nested destination blocks below for details.
    issuesFilter WorkflowIssuesFilter
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    mutingRulesHandling String
    How to handle muted issues. See Muting Rules below for details.
    accountId String
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    destinationsEnabled Boolean
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    enabled Boolean
    Whether workflow is enabled. Defaults to true.
    enrichments WorkflowEnrichments
    Workflow's enrichments. See Nested enrichments blocks below for details.
    enrichmentsEnabled Boolean
    Whether enrichments are enabled. Defaults to true.
    name String
    The name of the workflow.
    destinations WorkflowDestination[]
    Notification configuration. See Nested destination blocks below for details.
    issuesFilter WorkflowIssuesFilter
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    mutingRulesHandling string
    How to handle muted issues. See Muting Rules below for details.
    accountId string
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    destinationsEnabled boolean
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    enabled boolean
    Whether workflow is enabled. Defaults to true.
    enrichments WorkflowEnrichments
    Workflow's enrichments. See Nested enrichments blocks below for details.
    enrichmentsEnabled boolean
    Whether enrichments are enabled. Defaults to true.
    name string
    The name of the workflow.
    destinations Sequence[WorkflowDestinationArgs]
    Notification configuration. See Nested destination blocks below for details.
    issues_filter WorkflowIssuesFilterArgs
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    muting_rules_handling str
    How to handle muted issues. See Muting Rules below for details.
    account_id str
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    destinations_enabled bool
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    enabled bool
    Whether workflow is enabled. Defaults to true.
    enrichments WorkflowEnrichmentsArgs
    Workflow's enrichments. See Nested enrichments blocks below for details.
    enrichments_enabled bool
    Whether enrichments are enabled. Defaults to true.
    name str
    The name of the workflow.
    destinations List<Property Map>
    Notification configuration. See Nested destination blocks below for details.
    issuesFilter Property Map
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    mutingRulesHandling String
    How to handle muted issues. See Muting Rules below for details.
    accountId String
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    destinationsEnabled Boolean
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    enabled Boolean
    Whether workflow is enabled. Defaults to true.
    enrichments Property Map
    Workflow's enrichments. See Nested enrichments blocks below for details.
    enrichmentsEnabled Boolean
    Whether enrichments are enabled. Defaults to true.
    name String
    The name of the workflow.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Workflow resource produces the following output properties:

    Guid string
    Workflow entity GUID
    Id string
    The provider-assigned unique ID for this managed resource.
    LastRun string
    The last time notification was sent for this workflow.
    WorkflowId string
    The id of the workflow.
    Guid string
    Workflow entity GUID
    Id string
    The provider-assigned unique ID for this managed resource.
    LastRun string
    The last time notification was sent for this workflow.
    WorkflowId string
    The id of the workflow.
    guid String
    Workflow entity GUID
    id String
    The provider-assigned unique ID for this managed resource.
    lastRun String
    The last time notification was sent for this workflow.
    workflowId String
    The id of the workflow.
    guid string
    Workflow entity GUID
    id string
    The provider-assigned unique ID for this managed resource.
    lastRun string
    The last time notification was sent for this workflow.
    workflowId string
    The id of the workflow.
    guid str
    Workflow entity GUID
    id str
    The provider-assigned unique ID for this managed resource.
    last_run str
    The last time notification was sent for this workflow.
    workflow_id str
    The id of the workflow.
    guid String
    Workflow entity GUID
    id String
    The provider-assigned unique ID for this managed resource.
    lastRun String
    The last time notification was sent for this workflow.
    workflowId String
    The id of the workflow.

    Look up Existing Workflow Resource

    Get an existing Workflow 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?: WorkflowState, opts?: CustomResourceOptions): Workflow
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            destinations: Optional[Sequence[WorkflowDestinationArgs]] = None,
            destinations_enabled: Optional[bool] = None,
            enabled: Optional[bool] = None,
            enrichments: Optional[WorkflowEnrichmentsArgs] = None,
            enrichments_enabled: Optional[bool] = None,
            guid: Optional[str] = None,
            issues_filter: Optional[WorkflowIssuesFilterArgs] = None,
            last_run: Optional[str] = None,
            muting_rules_handling: Optional[str] = None,
            name: Optional[str] = None,
            workflow_id: Optional[str] = None) -> Workflow
    func GetWorkflow(ctx *Context, name string, id IDInput, state *WorkflowState, opts ...ResourceOption) (*Workflow, error)
    public static Workflow Get(string name, Input<string> id, WorkflowState? state, CustomResourceOptions? opts = null)
    public static Workflow get(String name, Output<String> id, WorkflowState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    AccountId string
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    Destinations List<Pulumi.NewRelic.Inputs.WorkflowDestination>
    Notification configuration. See Nested destination blocks below for details.
    DestinationsEnabled bool
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    Enabled bool
    Whether workflow is enabled. Defaults to true.
    Enrichments Pulumi.NewRelic.Inputs.WorkflowEnrichments
    Workflow's enrichments. See Nested enrichments blocks below for details.
    EnrichmentsEnabled bool
    Whether enrichments are enabled. Defaults to true.
    Guid string
    Workflow entity GUID
    IssuesFilter Pulumi.NewRelic.Inputs.WorkflowIssuesFilter
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    LastRun string
    The last time notification was sent for this workflow.
    MutingRulesHandling string
    How to handle muted issues. See Muting Rules below for details.
    Name string
    The name of the workflow.
    WorkflowId string
    The id of the workflow.
    AccountId string
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    Destinations []WorkflowDestinationArgs
    Notification configuration. See Nested destination blocks below for details.
    DestinationsEnabled bool
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    Enabled bool
    Whether workflow is enabled. Defaults to true.
    Enrichments WorkflowEnrichmentsArgs
    Workflow's enrichments. See Nested enrichments blocks below for details.
    EnrichmentsEnabled bool
    Whether enrichments are enabled. Defaults to true.
    Guid string
    Workflow entity GUID
    IssuesFilter WorkflowIssuesFilterArgs
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    LastRun string
    The last time notification was sent for this workflow.
    MutingRulesHandling string
    How to handle muted issues. See Muting Rules below for details.
    Name string
    The name of the workflow.
    WorkflowId string
    The id of the workflow.
    accountId String
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    destinations List<WorkflowDestination>
    Notification configuration. See Nested destination blocks below for details.
    destinationsEnabled Boolean
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    enabled Boolean
    Whether workflow is enabled. Defaults to true.
    enrichments WorkflowEnrichments
    Workflow's enrichments. See Nested enrichments blocks below for details.
    enrichmentsEnabled Boolean
    Whether enrichments are enabled. Defaults to true.
    guid String
    Workflow entity GUID
    issuesFilter WorkflowIssuesFilter
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    lastRun String
    The last time notification was sent for this workflow.
    mutingRulesHandling String
    How to handle muted issues. See Muting Rules below for details.
    name String
    The name of the workflow.
    workflowId String
    The id of the workflow.
    accountId string
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    destinations WorkflowDestination[]
    Notification configuration. See Nested destination blocks below for details.
    destinationsEnabled boolean
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    enabled boolean
    Whether workflow is enabled. Defaults to true.
    enrichments WorkflowEnrichments
    Workflow's enrichments. See Nested enrichments blocks below for details.
    enrichmentsEnabled boolean
    Whether enrichments are enabled. Defaults to true.
    guid string
    Workflow entity GUID
    issuesFilter WorkflowIssuesFilter
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    lastRun string
    The last time notification was sent for this workflow.
    mutingRulesHandling string
    How to handle muted issues. See Muting Rules below for details.
    name string
    The name of the workflow.
    workflowId string
    The id of the workflow.
    account_id str
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    destinations Sequence[WorkflowDestinationArgs]
    Notification configuration. See Nested destination blocks below for details.
    destinations_enabled bool
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    enabled bool
    Whether workflow is enabled. Defaults to true.
    enrichments WorkflowEnrichmentsArgs
    Workflow's enrichments. See Nested enrichments blocks below for details.
    enrichments_enabled bool
    Whether enrichments are enabled. Defaults to true.
    guid str
    Workflow entity GUID
    issues_filter WorkflowIssuesFilterArgs
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    last_run str
    The last time notification was sent for this workflow.
    muting_rules_handling str
    How to handle muted issues. See Muting Rules below for details.
    name str
    The name of the workflow.
    workflow_id str
    The id of the workflow.
    accountId String
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    destinations List<Property Map>
    Notification configuration. See Nested destination blocks below for details.
    destinationsEnabled Boolean
    DEPRECATED Whether destinations are enabled. Please use enabled instead: these two are different flags, but they are functionally identical. Defaults to true.

    Deprecated: Please use 'enabled' instead

    enabled Boolean
    Whether workflow is enabled. Defaults to true.
    enrichments Property Map
    Workflow's enrichments. See Nested enrichments blocks below for details.
    enrichmentsEnabled Boolean
    Whether enrichments are enabled. Defaults to true.
    guid String
    Workflow entity GUID
    issuesFilter Property Map
    A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
    lastRun String
    The last time notification was sent for this workflow.
    mutingRulesHandling String
    How to handle muted issues. See Muting Rules below for details.
    name String
    The name of the workflow.
    workflowId String
    The id of the workflow.

    Supporting Types

    WorkflowDestination, WorkflowDestinationArgs

    ChannelId string
    (Required) Destination's channel id.
    Name string
    The name of the workflow.
    NotificationTriggers List<string>
    List of triggers to notify about in this destination configuration.
    Type string
    (Required) The type of the destination. One of: (EMAIL, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION, PAGERDUTY_SERVICE_INTEGRATION, SERVICE_NOW, SERVICE_NOW_APP, WEBHOOK, MOBILE_PUSH, SLACK, JIRA).
    UpdateOriginalMessage bool
    Update original notification message (Slack channels only)
    ChannelId string
    (Required) Destination's channel id.
    Name string
    The name of the workflow.
    NotificationTriggers []string
    List of triggers to notify about in this destination configuration.
    Type string
    (Required) The type of the destination. One of: (EMAIL, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION, PAGERDUTY_SERVICE_INTEGRATION, SERVICE_NOW, SERVICE_NOW_APP, WEBHOOK, MOBILE_PUSH, SLACK, JIRA).
    UpdateOriginalMessage bool
    Update original notification message (Slack channels only)
    channelId String
    (Required) Destination's channel id.
    name String
    The name of the workflow.
    notificationTriggers List<String>
    List of triggers to notify about in this destination configuration.
    type String
    (Required) The type of the destination. One of: (EMAIL, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION, PAGERDUTY_SERVICE_INTEGRATION, SERVICE_NOW, SERVICE_NOW_APP, WEBHOOK, MOBILE_PUSH, SLACK, JIRA).
    updateOriginalMessage Boolean
    Update original notification message (Slack channels only)
    channelId string
    (Required) Destination's channel id.
    name string
    The name of the workflow.
    notificationTriggers string[]
    List of triggers to notify about in this destination configuration.
    type string
    (Required) The type of the destination. One of: (EMAIL, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION, PAGERDUTY_SERVICE_INTEGRATION, SERVICE_NOW, SERVICE_NOW_APP, WEBHOOK, MOBILE_PUSH, SLACK, JIRA).
    updateOriginalMessage boolean
    Update original notification message (Slack channels only)
    channel_id str
    (Required) Destination's channel id.
    name str
    The name of the workflow.
    notification_triggers Sequence[str]
    List of triggers to notify about in this destination configuration.
    type str
    (Required) The type of the destination. One of: (EMAIL, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION, PAGERDUTY_SERVICE_INTEGRATION, SERVICE_NOW, SERVICE_NOW_APP, WEBHOOK, MOBILE_PUSH, SLACK, JIRA).
    update_original_message bool
    Update original notification message (Slack channels only)
    channelId String
    (Required) Destination's channel id.
    name String
    The name of the workflow.
    notificationTriggers List<String>
    List of triggers to notify about in this destination configuration.
    type String
    (Required) The type of the destination. One of: (EMAIL, EVENT_BRIDGE, PAGERDUTY_ACCOUNT_INTEGRATION, PAGERDUTY_SERVICE_INTEGRATION, SERVICE_NOW, SERVICE_NOW_APP, WEBHOOK, MOBILE_PUSH, SLACK, JIRA).
    updateOriginalMessage Boolean
    Update original notification message (Slack channels only)

    WorkflowEnrichments, WorkflowEnrichmentsArgs

    Nrqls []WorkflowEnrichmentsNrql
    (Required) Nrql type Enrichments.
    nrqls List<WorkflowEnrichmentsNrql>
    (Required) Nrql type Enrichments.
    nrqls WorkflowEnrichmentsNrql[]
    (Required) Nrql type Enrichments.
    nrqls Sequence[WorkflowEnrichmentsNrql]
    (Required) Nrql type Enrichments.
    nrqls List<Property Map>
    (Required) Nrql type Enrichments.

    WorkflowEnrichmentsNrql, WorkflowEnrichmentsNrqlArgs

    Configurations List<Pulumi.NewRelic.Inputs.WorkflowEnrichmentsNrqlConfiguration>
    A set of key-value pairs to represent a enrichment configuration.
    Name string
    The name of the workflow.
    AccountId string
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    EnrichmentId string
    Enrichment's id.
    Type string
    The type of the enrichment. One of: (NRQL).
    Configurations []WorkflowEnrichmentsNrqlConfiguration
    A set of key-value pairs to represent a enrichment configuration.
    Name string
    The name of the workflow.
    AccountId string
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    EnrichmentId string
    Enrichment's id.
    Type string
    The type of the enrichment. One of: (NRQL).
    configurations List<WorkflowEnrichmentsNrqlConfiguration>
    A set of key-value pairs to represent a enrichment configuration.
    name String
    The name of the workflow.
    accountId String
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    enrichmentId String
    Enrichment's id.
    type String
    The type of the enrichment. One of: (NRQL).
    configurations WorkflowEnrichmentsNrqlConfiguration[]
    A set of key-value pairs to represent a enrichment configuration.
    name string
    The name of the workflow.
    accountId string
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    enrichmentId string
    Enrichment's id.
    type string
    The type of the enrichment. One of: (NRQL).
    configurations Sequence[WorkflowEnrichmentsNrqlConfiguration]
    A set of key-value pairs to represent a enrichment configuration.
    name str
    The name of the workflow.
    account_id str
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    enrichment_id str
    Enrichment's id.
    type str
    The type of the enrichment. One of: (NRQL).
    configurations List<Property Map>
    A set of key-value pairs to represent a enrichment configuration.
    name String
    The name of the workflow.
    accountId String
    Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
    enrichmentId String
    Enrichment's id.
    type String
    The type of the enrichment. One of: (NRQL).

    WorkflowEnrichmentsNrqlConfiguration, WorkflowEnrichmentsNrqlConfigurationArgs

    Query string
    enrichment's NRQL query
    Query string
    enrichment's NRQL query
    query String
    enrichment's NRQL query
    query string
    enrichment's NRQL query
    query str
    enrichment's NRQL query
    query String
    enrichment's NRQL query

    WorkflowIssuesFilter, WorkflowIssuesFilterArgs

    Name string
    (Required) Filter's name.
    Type string
    Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
    FilterId string
    filter id.
    Predicates List<Pulumi.NewRelic.Inputs.WorkflowIssuesFilterPredicate>
    A condition an issue event should satisfy to be processed by the workflow
    Name string
    (Required) Filter's name.
    Type string
    Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
    FilterId string
    filter id.
    Predicates []WorkflowIssuesFilterPredicate
    A condition an issue event should satisfy to be processed by the workflow
    name String
    (Required) Filter's name.
    type String
    Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
    filterId String
    filter id.
    predicates List<WorkflowIssuesFilterPredicate>
    A condition an issue event should satisfy to be processed by the workflow
    name string
    (Required) Filter's name.
    type string
    Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
    filterId string
    filter id.
    predicates WorkflowIssuesFilterPredicate[]
    A condition an issue event should satisfy to be processed by the workflow
    name str
    (Required) Filter's name.
    type str
    Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
    filter_id str
    filter id.
    predicates Sequence[WorkflowIssuesFilterPredicate]
    A condition an issue event should satisfy to be processed by the workflow
    name String
    (Required) Filter's name.
    type String
    Type of the filter. Please just set this field to FILTER. The field is likely to be deprecated/removed in the near future.
    filterId String
    filter id.
    predicates List<Property Map>
    A condition an issue event should satisfy to be processed by the workflow

    WorkflowIssuesFilterPredicate, WorkflowIssuesFilterPredicateArgs

    Attribute string
    Issue event attribute to check
    Operator string
    An operator to use to compare the attribute with the provided values, see supported operators below
    Values List<string>
    The attribute must match any of the values in this list
    Attribute string
    Issue event attribute to check
    Operator string
    An operator to use to compare the attribute with the provided values, see supported operators below
    Values []string
    The attribute must match any of the values in this list
    attribute String
    Issue event attribute to check
    operator String
    An operator to use to compare the attribute with the provided values, see supported operators below
    values List<String>
    The attribute must match any of the values in this list
    attribute string
    Issue event attribute to check
    operator string
    An operator to use to compare the attribute with the provided values, see supported operators below
    values string[]
    The attribute must match any of the values in this list
    attribute str
    Issue event attribute to check
    operator str
    An operator to use to compare the attribute with the provided values, see supported operators below
    values Sequence[str]
    The attribute must match any of the values in this list
    attribute String
    Issue event attribute to check
    operator String
    An operator to use to compare the attribute with the provided values, see supported operators below
    values List<String>
    The attribute must match any of the values in this list

    Import

    Workflows can be imported using the id, e.g.

    bash

    $ pulumi import newrelic:index/workflow:Workflow foo <id>
    

    You can find the workflow ID from the workflow table by clicking on … at the end of the row and choosing Copy workflow id to clipboard.

    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 newrelic Terraform Provider.
    newrelic logo
    New Relic v5.36.1 published on Tuesday, Nov 12, 2024 by Pulumi