# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = ['WorkflowArgs', 'Workflow']

@pulumi.input_type
class WorkflowArgs:
    def __init__(__self__, *,
                 destination_configurations: pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationConfigurationArgs']]],
                 issues_filter: pulumi.Input['WorkflowIssuesFilterArgs'],
                 muting_rules_handling: pulumi.Input[str],
                 account_id: Optional[pulumi.Input[int]] = None,
                 destinations_enabled: Optional[pulumi.Input[bool]] = None,
                 enrichments: Optional[pulumi.Input['WorkflowEnrichmentsArgs']] = None,
                 enrichments_enabled: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 workflow_enabled: Optional[pulumi.Input[bool]] = None):
        """
        The set of arguments for constructing a Workflow resource.
        :param pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationConfigurationArgs']]] destination_configurations: A nested block that contains a channel id.
        :param pulumi.Input['WorkflowIssuesFilterArgs'] issues_filter: The issues filter.  See Nested issues_filter blocks below for details.
        :param pulumi.Input[str] muting_rules_handling: Which muting rule handling this workflow has.
        :param pulumi.Input[int] account_id: Determines the New Relic account where the workflow will be created. Defaults to the account associated with the API key used.
        :param pulumi.Input[bool] destinations_enabled: Whether destinations are enabled..
        :param pulumi.Input['WorkflowEnrichmentsArgs'] enrichments: A nested block that describes a workflow's enrichments. See Nested enrichments blocks below for details.
        :param pulumi.Input[bool] enrichments_enabled: Whether enrichments are enabled..
        :param pulumi.Input[str] name: A nrql enrichment name.
        :param pulumi.Input[bool] workflow_enabled: Whether workflow is enabled.
        """
        pulumi.set(__self__, "destination_configurations", destination_configurations)
        pulumi.set(__self__, "issues_filter", issues_filter)
        pulumi.set(__self__, "muting_rules_handling", muting_rules_handling)
        if account_id is not None:
            pulumi.set(__self__, "account_id", account_id)
        if destinations_enabled is not None:
            pulumi.set(__self__, "destinations_enabled", destinations_enabled)
        if enrichments is not None:
            pulumi.set(__self__, "enrichments", enrichments)
        if enrichments_enabled is not None:
            pulumi.set(__self__, "enrichments_enabled", enrichments_enabled)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if workflow_enabled is not None:
            pulumi.set(__self__, "workflow_enabled", workflow_enabled)

    @property
    @pulumi.getter(name="destinationConfigurations")
    def destination_configurations(self) -> pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationConfigurationArgs']]]:
        """
        A nested block that contains a channel id.
        """
        return pulumi.get(self, "destination_configurations")

    @destination_configurations.setter
    def destination_configurations(self, value: pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationConfigurationArgs']]]):
        pulumi.set(self, "destination_configurations", value)

    @property
    @pulumi.getter(name="issuesFilter")
    def issues_filter(self) -> pulumi.Input['WorkflowIssuesFilterArgs']:
        """
        The issues filter.  See Nested issues_filter blocks below for details.
        """
        return pulumi.get(self, "issues_filter")

    @issues_filter.setter
    def issues_filter(self, value: pulumi.Input['WorkflowIssuesFilterArgs']):
        pulumi.set(self, "issues_filter", value)

    @property
    @pulumi.getter(name="mutingRulesHandling")
    def muting_rules_handling(self) -> pulumi.Input[str]:
        """
        Which muting rule handling this workflow has.
        """
        return pulumi.get(self, "muting_rules_handling")

    @muting_rules_handling.setter
    def muting_rules_handling(self, value: pulumi.Input[str]):
        pulumi.set(self, "muting_rules_handling", value)

    @property
    @pulumi.getter(name="accountId")
    def account_id(self) -> Optional[pulumi.Input[int]]:
        """
        Determines the New Relic account where the workflow will be created. Defaults to the account associated with the API key used.
        """
        return pulumi.get(self, "account_id")

    @account_id.setter
    def account_id(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "account_id", value)

    @property
    @pulumi.getter(name="destinationsEnabled")
    def destinations_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether destinations are enabled..
        """
        return pulumi.get(self, "destinations_enabled")

    @destinations_enabled.setter
    def destinations_enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "destinations_enabled", value)

    @property
    @pulumi.getter
    def enrichments(self) -> Optional[pulumi.Input['WorkflowEnrichmentsArgs']]:
        """
        A nested block that describes a workflow's enrichments. See Nested enrichments blocks below for details.
        """
        return pulumi.get(self, "enrichments")

    @enrichments.setter
    def enrichments(self, value: Optional[pulumi.Input['WorkflowEnrichmentsArgs']]):
        pulumi.set(self, "enrichments", value)

    @property
    @pulumi.getter(name="enrichmentsEnabled")
    def enrichments_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether enrichments are enabled..
        """
        return pulumi.get(self, "enrichments_enabled")

    @enrichments_enabled.setter
    def enrichments_enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "enrichments_enabled", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        A nrql enrichment name.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter(name="workflowEnabled")
    def workflow_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether workflow is enabled.
        """
        return pulumi.get(self, "workflow_enabled")

    @workflow_enabled.setter
    def workflow_enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "workflow_enabled", value)


@pulumi.input_type
class _WorkflowState:
    def __init__(__self__, *,
                 account_id: Optional[pulumi.Input[int]] = None,
                 destination_configurations: Optional[pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationConfigurationArgs']]]] = None,
                 destinations_enabled: Optional[pulumi.Input[bool]] = None,
                 enrichments: Optional[pulumi.Input['WorkflowEnrichmentsArgs']] = None,
                 enrichments_enabled: Optional[pulumi.Input[bool]] = None,
                 issues_filter: Optional[pulumi.Input['WorkflowIssuesFilterArgs']] = None,
                 last_run: Optional[pulumi.Input[str]] = None,
                 muting_rules_handling: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 workflow_enabled: Optional[pulumi.Input[bool]] = None,
                 workflow_id: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering Workflow resources.
        :param pulumi.Input[int] account_id: Determines the New Relic account where the workflow will be created. Defaults to the account associated with the API key used.
        :param pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationConfigurationArgs']]] destination_configurations: A nested block that contains a channel id.
        :param pulumi.Input[bool] destinations_enabled: Whether destinations are enabled..
        :param pulumi.Input['WorkflowEnrichmentsArgs'] enrichments: A nested block that describes a workflow's enrichments. See Nested enrichments blocks below for details.
        :param pulumi.Input[bool] enrichments_enabled: Whether enrichments are enabled..
        :param pulumi.Input['WorkflowIssuesFilterArgs'] issues_filter: The issues filter.  See Nested issues_filter blocks below for details.
        :param pulumi.Input[str] last_run: The last time notification was sent for this workflow.
        :param pulumi.Input[str] muting_rules_handling: Which muting rule handling this workflow has.
        :param pulumi.Input[str] name: A nrql enrichment name.
        :param pulumi.Input[bool] workflow_enabled: Whether workflow is enabled.
        :param pulumi.Input[str] workflow_id: The id of the workflow.
        """
        if account_id is not None:
            pulumi.set(__self__, "account_id", account_id)
        if destination_configurations is not None:
            pulumi.set(__self__, "destination_configurations", destination_configurations)
        if destinations_enabled is not None:
            pulumi.set(__self__, "destinations_enabled", destinations_enabled)
        if enrichments is not None:
            pulumi.set(__self__, "enrichments", enrichments)
        if enrichments_enabled is not None:
            pulumi.set(__self__, "enrichments_enabled", enrichments_enabled)
        if issues_filter is not None:
            pulumi.set(__self__, "issues_filter", issues_filter)
        if last_run is not None:
            pulumi.set(__self__, "last_run", last_run)
        if muting_rules_handling is not None:
            pulumi.set(__self__, "muting_rules_handling", muting_rules_handling)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if workflow_enabled is not None:
            pulumi.set(__self__, "workflow_enabled", workflow_enabled)
        if workflow_id is not None:
            pulumi.set(__self__, "workflow_id", workflow_id)

    @property
    @pulumi.getter(name="accountId")
    def account_id(self) -> Optional[pulumi.Input[int]]:
        """
        Determines the New Relic account where the workflow will be created. Defaults to the account associated with the API key used.
        """
        return pulumi.get(self, "account_id")

    @account_id.setter
    def account_id(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "account_id", value)

    @property
    @pulumi.getter(name="destinationConfigurations")
    def destination_configurations(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationConfigurationArgs']]]]:
        """
        A nested block that contains a channel id.
        """
        return pulumi.get(self, "destination_configurations")

    @destination_configurations.setter
    def destination_configurations(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationConfigurationArgs']]]]):
        pulumi.set(self, "destination_configurations", value)

    @property
    @pulumi.getter(name="destinationsEnabled")
    def destinations_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether destinations are enabled..
        """
        return pulumi.get(self, "destinations_enabled")

    @destinations_enabled.setter
    def destinations_enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "destinations_enabled", value)

    @property
    @pulumi.getter
    def enrichments(self) -> Optional[pulumi.Input['WorkflowEnrichmentsArgs']]:
        """
        A nested block that describes a workflow's enrichments. See Nested enrichments blocks below for details.
        """
        return pulumi.get(self, "enrichments")

    @enrichments.setter
    def enrichments(self, value: Optional[pulumi.Input['WorkflowEnrichmentsArgs']]):
        pulumi.set(self, "enrichments", value)

    @property
    @pulumi.getter(name="enrichmentsEnabled")
    def enrichments_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether enrichments are enabled..
        """
        return pulumi.get(self, "enrichments_enabled")

    @enrichments_enabled.setter
    def enrichments_enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "enrichments_enabled", value)

    @property
    @pulumi.getter(name="issuesFilter")
    def issues_filter(self) -> Optional[pulumi.Input['WorkflowIssuesFilterArgs']]:
        """
        The issues filter.  See Nested issues_filter blocks below for details.
        """
        return pulumi.get(self, "issues_filter")

    @issues_filter.setter
    def issues_filter(self, value: Optional[pulumi.Input['WorkflowIssuesFilterArgs']]):
        pulumi.set(self, "issues_filter", value)

    @property
    @pulumi.getter(name="lastRun")
    def last_run(self) -> Optional[pulumi.Input[str]]:
        """
        The last time notification was sent for this workflow.
        """
        return pulumi.get(self, "last_run")

    @last_run.setter
    def last_run(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "last_run", value)

    @property
    @pulumi.getter(name="mutingRulesHandling")
    def muting_rules_handling(self) -> Optional[pulumi.Input[str]]:
        """
        Which muting rule handling this workflow has.
        """
        return pulumi.get(self, "muting_rules_handling")

    @muting_rules_handling.setter
    def muting_rules_handling(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "muting_rules_handling", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        A nrql enrichment name.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)

    @property
    @pulumi.getter(name="workflowEnabled")
    def workflow_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether workflow is enabled.
        """
        return pulumi.get(self, "workflow_enabled")

    @workflow_enabled.setter
    def workflow_enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "workflow_enabled", value)

    @property
    @pulumi.getter(name="workflowId")
    def workflow_id(self) -> Optional[pulumi.Input[str]]:
        """
        The id of the workflow.
        """
        return pulumi.get(self, "workflow_id")

    @workflow_id.setter
    def workflow_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "workflow_id", value)


class Workflow(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 account_id: Optional[pulumi.Input[int]] = None,
                 destination_configurations: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkflowDestinationConfigurationArgs']]]]] = None,
                 destinations_enabled: Optional[pulumi.Input[bool]] = None,
                 enrichments: Optional[pulumi.Input[pulumi.InputType['WorkflowEnrichmentsArgs']]] = None,
                 enrichments_enabled: Optional[pulumi.Input[bool]] = None,
                 issues_filter: Optional[pulumi.Input[pulumi.InputType['WorkflowIssuesFilterArgs']]] = None,
                 muting_rules_handling: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 workflow_enabled: Optional[pulumi.Input[bool]] = None,
                 __props__=None):
        """
        Use this resource to create and manage New Relic workflow.

        ## Example Usage

        ##### Workflow
        ```python
        import pulumi
        import pulumi_newrelic as newrelic

        foo = newrelic.Workflow("foo",
            account_id=12345678,
            destination_configurations=[
                newrelic.WorkflowDestinationConfigurationArgs(
                    channel_id="20d86999-169c-461a-9c16-3cf330f4b3aa",
                ),
                newrelic.WorkflowDestinationConfigurationArgs(
                    channel_id="e6af0870-cabb-453f-bf0d-fb2b6a14e05c",
                ),
            ],
            destinations_enabled=True,
            enrichments=newrelic.WorkflowEnrichmentsArgs(
                nrqls=[
                    newrelic.WorkflowEnrichmentsNrqlArgs(
                        configurations=[newrelic.WorkflowEnrichmentsNrqlConfigurationArgs(
                            query="SELECT * FROM Log",
                        )],
                        name="Log",
                    ),
                    newrelic.WorkflowEnrichmentsNrqlArgs(
                        configurations=[newrelic.WorkflowEnrichmentsNrqlConfigurationArgs(
                            query="SELECT * FROM Metric",
                        )],
                        name="Metric",
                    ),
                ],
            ),
            enrichments_enabled=False,
            issues_filter=newrelic.WorkflowIssuesFilterArgs(
                name="filter-name",
                predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
                    attribute="accumulations.sources",
                    operator="EXACTLY_MATCHES",
                    values=[
                        "newrelic",
                        "pagerduty",
                    ],
                )],
                type="FILTER",
            ),
            muting_rules_handling="NOTIFY_ALL_ISSUES",
            workflow_enabled=True)
        ```
        ## Full Scenario Example

        Create a destination resource and reference that destination to the channel resource. Then create a workflow and reference the channel resource to it.

        ### Create a destination
        ```python
        import pulumi
        import pulumi_newrelic as newrelic

        webhook_destination = newrelic.NotificationDestination("webhook-destination",
            account_id=12345678,
            auth_basic=newrelic.NotificationDestinationAuthBasicArgs(
                password="password",
                user="username",
            ),
            properties=[newrelic.NotificationDestinationPropertyArgs(
                key="url",
                value="https://webhook.site/94193c01-4a81-4782-8f1b-554d5230395b",
            )],
            type="WEBHOOK")
        ```

        ### Create a channel
        ```python
        import pulumi
        import pulumi_newrelic as newrelic

        webhook_channel = newrelic.NotificationChannel("webhook-channel",
            account_id=12345678,
            type="WEBHOOK",
            destination_id=newrelic_notification_destination["webhook-destination"]["id"],
            product="IINT",
            properties=[newrelic.NotificationChannelPropertyArgs(
                key="payload",
                value="{name: foo}",
                label="Payload Template",
            )])
        ```

        ### Create a workflow
        ```python
        import pulumi
        import pulumi_newrelic as newrelic

        workflow_example = newrelic.Workflow("workflow-example",
            account_id=12345678,
            muting_rules_handling="NOTIFY_ALL_ISSUES",
            enrichments=newrelic.WorkflowEnrichmentsArgs(
                nrqls=[newrelic.WorkflowEnrichmentsNrqlArgs(
                    name="Log count",
                    configurations=[newrelic.WorkflowEnrichmentsNrqlConfigurationArgs(
                        query="SELECT count(*) FROM Log",
                    )],
                )],
            ),
            issues_filter=newrelic.WorkflowIssuesFilterArgs(
                name="Filter-name",
                type="FILTER",
                predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
                    attribute="accumulations.sources",
                    operator="EXACTLY_MATCHES",
                    values=["newrelic"],
                )],
            ),
            destination_configurations=[newrelic.WorkflowDestinationConfigurationArgs(
                channel_id=newrelic_notification_channel["webhook-channel"]["id"],
            )])
        ```

        ## Additional Information

        More details about the workflows can be found [here](https://docs.newrelic.com/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] account_id: Determines the New Relic account where the workflow will be created. Defaults to the account associated with the API key used.
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkflowDestinationConfigurationArgs']]]] destination_configurations: A nested block that contains a channel id.
        :param pulumi.Input[bool] destinations_enabled: Whether destinations are enabled..
        :param pulumi.Input[pulumi.InputType['WorkflowEnrichmentsArgs']] enrichments: A nested block that describes a workflow's enrichments. See Nested enrichments blocks below for details.
        :param pulumi.Input[bool] enrichments_enabled: Whether enrichments are enabled..
        :param pulumi.Input[pulumi.InputType['WorkflowIssuesFilterArgs']] issues_filter: The issues filter.  See Nested issues_filter blocks below for details.
        :param pulumi.Input[str] muting_rules_handling: Which muting rule handling this workflow has.
        :param pulumi.Input[str] name: A nrql enrichment name.
        :param pulumi.Input[bool] workflow_enabled: Whether workflow is enabled.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: WorkflowArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Use this resource to create and manage New Relic workflow.

        ## Example Usage

        ##### Workflow
        ```python
        import pulumi
        import pulumi_newrelic as newrelic

        foo = newrelic.Workflow("foo",
            account_id=12345678,
            destination_configurations=[
                newrelic.WorkflowDestinationConfigurationArgs(
                    channel_id="20d86999-169c-461a-9c16-3cf330f4b3aa",
                ),
                newrelic.WorkflowDestinationConfigurationArgs(
                    channel_id="e6af0870-cabb-453f-bf0d-fb2b6a14e05c",
                ),
            ],
            destinations_enabled=True,
            enrichments=newrelic.WorkflowEnrichmentsArgs(
                nrqls=[
                    newrelic.WorkflowEnrichmentsNrqlArgs(
                        configurations=[newrelic.WorkflowEnrichmentsNrqlConfigurationArgs(
                            query="SELECT * FROM Log",
                        )],
                        name="Log",
                    ),
                    newrelic.WorkflowEnrichmentsNrqlArgs(
                        configurations=[newrelic.WorkflowEnrichmentsNrqlConfigurationArgs(
                            query="SELECT * FROM Metric",
                        )],
                        name="Metric",
                    ),
                ],
            ),
            enrichments_enabled=False,
            issues_filter=newrelic.WorkflowIssuesFilterArgs(
                name="filter-name",
                predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
                    attribute="accumulations.sources",
                    operator="EXACTLY_MATCHES",
                    values=[
                        "newrelic",
                        "pagerduty",
                    ],
                )],
                type="FILTER",
            ),
            muting_rules_handling="NOTIFY_ALL_ISSUES",
            workflow_enabled=True)
        ```
        ## Full Scenario Example

        Create a destination resource and reference that destination to the channel resource. Then create a workflow and reference the channel resource to it.

        ### Create a destination
        ```python
        import pulumi
        import pulumi_newrelic as newrelic

        webhook_destination = newrelic.NotificationDestination("webhook-destination",
            account_id=12345678,
            auth_basic=newrelic.NotificationDestinationAuthBasicArgs(
                password="password",
                user="username",
            ),
            properties=[newrelic.NotificationDestinationPropertyArgs(
                key="url",
                value="https://webhook.site/94193c01-4a81-4782-8f1b-554d5230395b",
            )],
            type="WEBHOOK")
        ```

        ### Create a channel
        ```python
        import pulumi
        import pulumi_newrelic as newrelic

        webhook_channel = newrelic.NotificationChannel("webhook-channel",
            account_id=12345678,
            type="WEBHOOK",
            destination_id=newrelic_notification_destination["webhook-destination"]["id"],
            product="IINT",
            properties=[newrelic.NotificationChannelPropertyArgs(
                key="payload",
                value="{name: foo}",
                label="Payload Template",
            )])
        ```

        ### Create a workflow
        ```python
        import pulumi
        import pulumi_newrelic as newrelic

        workflow_example = newrelic.Workflow("workflow-example",
            account_id=12345678,
            muting_rules_handling="NOTIFY_ALL_ISSUES",
            enrichments=newrelic.WorkflowEnrichmentsArgs(
                nrqls=[newrelic.WorkflowEnrichmentsNrqlArgs(
                    name="Log count",
                    configurations=[newrelic.WorkflowEnrichmentsNrqlConfigurationArgs(
                        query="SELECT count(*) FROM Log",
                    )],
                )],
            ),
            issues_filter=newrelic.WorkflowIssuesFilterArgs(
                name="Filter-name",
                type="FILTER",
                predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
                    attribute="accumulations.sources",
                    operator="EXACTLY_MATCHES",
                    values=["newrelic"],
                )],
            ),
            destination_configurations=[newrelic.WorkflowDestinationConfigurationArgs(
                channel_id=newrelic_notification_channel["webhook-channel"]["id"],
            )])
        ```

        ## Additional Information

        More details about the workflows can be found [here](https://docs.newrelic.com/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).

        :param str resource_name: The name of the resource.
        :param WorkflowArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(WorkflowArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 account_id: Optional[pulumi.Input[int]] = None,
                 destination_configurations: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkflowDestinationConfigurationArgs']]]]] = None,
                 destinations_enabled: Optional[pulumi.Input[bool]] = None,
                 enrichments: Optional[pulumi.Input[pulumi.InputType['WorkflowEnrichmentsArgs']]] = None,
                 enrichments_enabled: Optional[pulumi.Input[bool]] = None,
                 issues_filter: Optional[pulumi.Input[pulumi.InputType['WorkflowIssuesFilterArgs']]] = None,
                 muting_rules_handling: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 workflow_enabled: Optional[pulumi.Input[bool]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = WorkflowArgs.__new__(WorkflowArgs)

            __props__.__dict__["account_id"] = account_id
            if destination_configurations is None and not opts.urn:
                raise TypeError("Missing required property 'destination_configurations'")
            __props__.__dict__["destination_configurations"] = destination_configurations
            __props__.__dict__["destinations_enabled"] = destinations_enabled
            __props__.__dict__["enrichments"] = enrichments
            __props__.__dict__["enrichments_enabled"] = enrichments_enabled
            if issues_filter is None and not opts.urn:
                raise TypeError("Missing required property 'issues_filter'")
            __props__.__dict__["issues_filter"] = issues_filter
            if muting_rules_handling is None and not opts.urn:
                raise TypeError("Missing required property 'muting_rules_handling'")
            __props__.__dict__["muting_rules_handling"] = muting_rules_handling
            __props__.__dict__["name"] = name
            __props__.__dict__["workflow_enabled"] = workflow_enabled
            __props__.__dict__["last_run"] = None
            __props__.__dict__["workflow_id"] = None
        super(Workflow, __self__).__init__(
            'newrelic:index/workflow:Workflow',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            account_id: Optional[pulumi.Input[int]] = None,
            destination_configurations: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkflowDestinationConfigurationArgs']]]]] = None,
            destinations_enabled: Optional[pulumi.Input[bool]] = None,
            enrichments: Optional[pulumi.Input[pulumi.InputType['WorkflowEnrichmentsArgs']]] = None,
            enrichments_enabled: Optional[pulumi.Input[bool]] = None,
            issues_filter: Optional[pulumi.Input[pulumi.InputType['WorkflowIssuesFilterArgs']]] = None,
            last_run: Optional[pulumi.Input[str]] = None,
            muting_rules_handling: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            workflow_enabled: Optional[pulumi.Input[bool]] = None,
            workflow_id: Optional[pulumi.Input[str]] = None) -> 'Workflow':
        """
        Get an existing Workflow resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] account_id: Determines the New Relic account where the workflow will be created. Defaults to the account associated with the API key used.
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkflowDestinationConfigurationArgs']]]] destination_configurations: A nested block that contains a channel id.
        :param pulumi.Input[bool] destinations_enabled: Whether destinations are enabled..
        :param pulumi.Input[pulumi.InputType['WorkflowEnrichmentsArgs']] enrichments: A nested block that describes a workflow's enrichments. See Nested enrichments blocks below for details.
        :param pulumi.Input[bool] enrichments_enabled: Whether enrichments are enabled..
        :param pulumi.Input[pulumi.InputType['WorkflowIssuesFilterArgs']] issues_filter: The issues filter.  See Nested issues_filter blocks below for details.
        :param pulumi.Input[str] last_run: The last time notification was sent for this workflow.
        :param pulumi.Input[str] muting_rules_handling: Which muting rule handling this workflow has.
        :param pulumi.Input[str] name: A nrql enrichment name.
        :param pulumi.Input[bool] workflow_enabled: Whether workflow is enabled.
        :param pulumi.Input[str] workflow_id: The id of the workflow.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _WorkflowState.__new__(_WorkflowState)

        __props__.__dict__["account_id"] = account_id
        __props__.__dict__["destination_configurations"] = destination_configurations
        __props__.__dict__["destinations_enabled"] = destinations_enabled
        __props__.__dict__["enrichments"] = enrichments
        __props__.__dict__["enrichments_enabled"] = enrichments_enabled
        __props__.__dict__["issues_filter"] = issues_filter
        __props__.__dict__["last_run"] = last_run
        __props__.__dict__["muting_rules_handling"] = muting_rules_handling
        __props__.__dict__["name"] = name
        __props__.__dict__["workflow_enabled"] = workflow_enabled
        __props__.__dict__["workflow_id"] = workflow_id
        return Workflow(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="accountId")
    def account_id(self) -> pulumi.Output[Optional[int]]:
        """
        Determines the New Relic account where the workflow will be created. Defaults to the account associated with the API key used.
        """
        return pulumi.get(self, "account_id")

    @property
    @pulumi.getter(name="destinationConfigurations")
    def destination_configurations(self) -> pulumi.Output[Sequence['outputs.WorkflowDestinationConfiguration']]:
        """
        A nested block that contains a channel id.
        """
        return pulumi.get(self, "destination_configurations")

    @property
    @pulumi.getter(name="destinationsEnabled")
    def destinations_enabled(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether destinations are enabled..
        """
        return pulumi.get(self, "destinations_enabled")

    @property
    @pulumi.getter
    def enrichments(self) -> pulumi.Output[Optional['outputs.WorkflowEnrichments']]:
        """
        A nested block that describes a workflow's enrichments. See Nested enrichments blocks below for details.
        """
        return pulumi.get(self, "enrichments")

    @property
    @pulumi.getter(name="enrichmentsEnabled")
    def enrichments_enabled(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether enrichments are enabled..
        """
        return pulumi.get(self, "enrichments_enabled")

    @property
    @pulumi.getter(name="issuesFilter")
    def issues_filter(self) -> pulumi.Output['outputs.WorkflowIssuesFilter']:
        """
        The issues filter.  See Nested issues_filter blocks below for details.
        """
        return pulumi.get(self, "issues_filter")

    @property
    @pulumi.getter(name="lastRun")
    def last_run(self) -> pulumi.Output[str]:
        """
        The last time notification was sent for this workflow.
        """
        return pulumi.get(self, "last_run")

    @property
    @pulumi.getter(name="mutingRulesHandling")
    def muting_rules_handling(self) -> pulumi.Output[str]:
        """
        Which muting rule handling this workflow has.
        """
        return pulumi.get(self, "muting_rules_handling")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        A nrql enrichment name.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="workflowEnabled")
    def workflow_enabled(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether workflow is enabled.
        """
        return pulumi.get(self, "workflow_enabled")

    @property
    @pulumi.getter(name="workflowId")
    def workflow_id(self) -> pulumi.Output[str]:
        """
        The id of the workflow.
        """
        return pulumi.get(self, "workflow_id")

