Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
57e165f
Revert "Revert "Updated the actions catalog and restructured it""
adutta-newrelic Dec 11, 2025
2e67b7c
Updated the doc
adutta-newrelic Dec 12, 2025
8984c45
Removed / from unnessary places
adutta-newrelic Dec 12, 2025
b3b49f2
Updates
adutta-newrelic Dec 12, 2025
89a5123
Merge branch 'develop' into revert-22420-revert-22250-update-actions-…
adutta-newrelic Dec 12, 2025
e65340f
Updated the .nav structure
adutta-newrelic Dec 12, 2025
b697945
Feedback added
adutta-newrelic Dec 12, 2025
8e990bb
Updates
adutta-newrelic Dec 12, 2025
175304f
Updated the navigation
adutta-newrelic Dec 12, 2025
129ca0a
Removed actions catalog overview page
adutta-newrelic Dec 12, 2025
fbba1d5
Removed the orphan files
adutta-newrelic Dec 12, 2025
bc2c61b
Merge branch 'develop' into revert-22420-revert-22250-update-actions-…
adutta-newrelic Dec 12, 2025
02889c5
Updated the information
adutta-newrelic Dec 15, 2025
3a30705
Updated the indentation
adutta-newrelic Dec 15, 2025
0d8314c
Updates
adutta-newrelic Dec 15, 2025
6624541
Updates';
adutta-newrelic Dec 15, 2025
3213c64
Updates
adutta-newrelic Dec 15, 2025
fa7a738
Alignment
adutta-newrelic Dec 15, 2025
03e98af
Updated the example
adutta-newrelic Dec 15, 2025
ff8f2e2
Updates
adutta-newrelic Dec 15, 2025
78040a5
Updated the example
adutta-newrelic Dec 15, 2025
54ab759
Updated the indentation errors
adutta-newrelic Dec 15, 2025
5633b7e
Updated the indentation
adutta-newrelic Dec 15, 2025
79fdf64
Updated the table structure
adutta-newrelic Dec 15, 2025
e74b9e2
Updated the navigation
adutta-newrelic Dec 15, 2025
1489768
Updated the indentation
adutta-newrelic Dec 15, 2025
5c3bda4
Updated the numbering
adutta-newrelic Dec 15, 2025
7c5177d
Updated
adutta-newrelic Dec 15, 2025
94f90d8
Updated
adutta-newrelic Dec 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/content/docs/alerts/get-notified/destinations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ The supported destination platforms include:
* AWS EventBridge: Available in [workflows](/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).
* PagerDuty: Available in [workflows](/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).
* New Relic Mobile Push: Available in [workflows](/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).
* Microsoft Teams: Available in [workflows](/docs/alerts/get-notified/microsoft-teams-integrations/).
* Microsoft Teams: Available in [workflows](/docs/alerts/get-notified/microsoft-teams-integrations/).
* **Workflow Automation**: Available in [workflows](/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/). Triggers [automated incident response workflows](/docs/workflow-automation/setup-and-configuration/create-destinations#trigger-from-alerts) when alert conditions are breached.

For more on these and other destinations, see [notification integrations](/docs/alerts-applied-intelligence/notifications/notification-integrations).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ When templates don't fit your needs, [Create Your Own](https://onenr.io/0OQM47Kg

This guide shows you how to build workflows using concepts and a complete example. Choose your learning path:

- **Learn core concepts first** Read [Core concepts](#core-concepts) and [Workflow patterns](#workflow-patterns) to understand the fundamentals, then apply them
- **Follow the example** Jump to [Example walkthrough](#example-walkthrough) to build an EC2 auto-resize workflow step-by-step
- **Reference patterns** Use the [Workflow patterns](#workflow-patterns) section as a quick reference when building your own workflows
- **Learn core concepts first**: Read [Core concepts](#core-concepts) and [Workflow patterns](#workflow-patterns) to understand the fundamentals, then apply them
- **Follow the example**: Jump to [Example walkthrough](#example-walkthrough) to build an EC2 auto-resize workflow step-by-step
- **Reference patterns**: Use the [Workflow patterns](#workflow-patterns) section as a quick reference when building your own workflows

<Callout variant="tip">
**New to workflows?** Start with core concepts, then follow the example. The EC2 workflow demonstrates all key patterns in a real-world scenario.
Expand Down Expand Up @@ -62,109 +62,86 @@ Understand these fundamentals before you build:
<td>
Inputs and secrets
</td>

<td>
Parameters for credentials and configuration
</td>

<td>
`${{ :secrets:awsKeyId }}` for credentials, `${{ .inputs.region }}` for config.
</td>
</tr>

<tr>
<td>
Actions (Play)
</td>

<td>
Pre-built integrations (AWS, Slack, databases, APIs)
</td>

<td>
Drag `aws.ec2.stopInstances` into workflow canvas
</td>
</tr>

<tr>
<td>
Data flow
</td>

<td>
Pass outputs between steps
</td>

<td>
`${{ .steps.getAlert.outputs.entityGuid }}`
</td>
</tr>

<tr>
<td>
Switches
</td>

<td>
Create different paths based on conditions
</td>

<td>
Route by `CPU > 90%` vs. `70-90%` vs. `< 70%`
</td>
</tr>

<tr>
<td>
Loops
[Loops](/docs/workflow-automation/workflow-examples#loop-structure)
</td>

<td>
Process lists or poll for completion
</td>

<td>
Use `type: loop` with `for` and `in` to iterate over collections
</td>
</tr>

<tr>
<td>
Range
</td>

<td>
Mandatory field for loop functions to define iteration count
Required parameter for loop functions to define iteration count
</td>

<td>
Use `${{ range(1, 6) }}` to loop 5 times
</td>
</tr>

<tr>
<td>
Wait
</td>

<td>
Pauses workflow execution for a specified duration or until a condition is satisfied
</td>

<td>
Use `type: wait` with `seconds: 60` to delay 60 seconds
</td>
</tr>

<tr>
<td>
Stop
</td>

<td>
Terminate workflow execution
</td>

<td>
Ends workflow after validation failures or cancellations
</td>
Expand All @@ -183,7 +160,7 @@ For detailed error handling patterns, see [Best practices](/docs/workflow-automa
Build your first workflow in five steps:

1. Navigate to **[one.newrelic.com](https://one.newrelic.com) > All Capabilities > Workflow Automation** and select **[Create Your Own](https://onenr.io/0OQM47KgxjG)**
2. Define parameters for credentials (from secrets manager: `${{ :secrets:keyName }}`), configuration (regions, instance types), and runtime data (account IDs, alert IDs)
2. Define parameters for credentials (from [secrets manager](/docs/workflow-automation/limitations-and-faq/workflow-best-practices/#secure-credentials): `${{ :secrets:keyName }}`), configuration (regions, instance types), and runtime data (account IDs, alert IDs)
3. Drag actions from the [catalog](/docs/workflow-automation/setup-and-configuration/actions-catalog/actions-catalog), connect them with `${{ .steps.stepName.outputs.field }}` syntax to pass data
4. Insert switches for conditional branching, loops for processing lists or polling, approval gates for human decisions
5. Run after each section to catch errors early, then [start or schedule](/docs/workflow-automation/create-a-workflow-automation/start-schedule) your workflow
Expand All @@ -201,97 +178,102 @@ Four essential patterns handle most automation scenarios. Each pattern is demons
**Use switches when:** Outcomes vary based on data (threshold checks, API responses, user decisions)

**Key syntax:**
```yaml
- name: hasCompleted
type: switch
switch:
- condition: "${{ .steps.waitForCompletion.outputs.automationExecutionStatus == 'Failed' }}"
next: displayError
- condition: "${{ .steps.waitForCompletion.outputs.automationExecutionStatus == 'Success' }}"
next: displaySuccess
next: displayUnexpected # Default path when no condition matches
```
```yaml
- name: hasCompleted
type: switch
switch:
- condition: "${{ .steps.waitForCompletion.outputs.automationExecutionStatus == 'Failed' }}"
next: displayError
- condition: "${{ .steps.waitForCompletion.outputs.automationExecutionStatus == 'Success' }}"
next: displaySuccess
next: displayUnexpected # Default path when no condition matches
```

**See it in action:** [Handle team response](#handle-team-response) and [Verify and clean up](#verify-and-clean-up) sections show switches routing based on Slack reactions and AWS SSM status.

### Loops for processing lists

**Use loops when:** Processing multiple items or repeating actions

For detailed information about loop structure, parameters, and advanced usage (including break/continue), see [Loop structure](/docs/workflow-automation/workflow-examples#loop-structure).

**Key syntax:**
```yaml
# Send progress updates using range loop
- name: progressLoop
type: loop
for:
in: "${{ [range(1; 5)] }}" # Loop 5 times
steps:
- name: wait
type: wait
seconds: 10
- name: progressMessage
type: action
action: slack.chat.postMessage
version: 1
inputs:
channel: "${{ .workflowInputs.channel }}"
text: "Resizing in progress..."
```
```yaml
# Send progress updates using range loop
- name: progressLoop
type: loop
for:
in: "${{ [range(1; 5)] }}" # Loop 5 times
steps:
- name: wait
type: wait
seconds: 10
- name: progressMessage
type: action
action: slack.chat.postMessage
version: 1
inputs:
channel: "${{ .workflowInputs.channel }}"
text: "Resizing in progress..."
```

**See it in action:** [Execute the resize](#execute-the-resize) section uses `progressLoop` for status updates.

### Approval gates and waiting

**Use approval gates when:** Human judgment needed before destructive operations or compliance sign-off required
**Use approval gates when:** Human judgment is needed before destructive operations or compliance sign-off is required

**Key syntax:**
```yaml
- name: requestApproval
type: action
action: slack.chat.postMessage
version: 1
inputs:
channel: "#approvals"
text: "Approve? React with :thumbsup: or :thumbsdown:"

- name: getReactions
type: action
action: slack.chat.getReactions
version: 1
inputs:
token: "${{ .workflowInputs.slackToken }}"
channelID: "${{ .steps.requestApproval.outputs.channelID }}"
threadTs: "${{ .steps.requestApproval.outputs.threadTs }}"
timeout: 300 # Wait 5 minutes for reaction

- name: checkApproval
type: switch
switch:
- condition: '${{ .steps.getReactions.outputs.reactions | any(.name == "+1") }}'
next: handleApproval
- condition: '${{ .steps.getReactions.outputs.reactions | any(.name == "-1") }}'
next: handleRejection
```

```yaml
- name: requestApproval
type: action
action: slack.chat.postMessage
version: 1
inputs:
channel: "#approvals"
text: "Approve? React with :thumbsup: or :thumbsdown:"

- name: getReactions
type: action
action: slack.chat.getReactions
version: 1
inputs:
token: "${{ .workflowInputs.slackToken }}"
channelID: "${{ .steps.requestApproval.outputs.channelID }}"
threadTs: "${{ .steps.requestApproval.outputs.threadTs }}"
timeout: 300 # Wait 5 minutes for reaction

- name: checkApproval
type: switch
switch:
- condition: '${{ .steps.getReactions.outputs.reactions | any(.name == "+1") }}'
next: handleApproval
- condition: '${{ .steps.getReactions.outputs.reactions | any(.name == "-1") }}'
next: handleRejection
```

**For simple delays:**
```yaml
- name: waitBeforeRetry
type: wait
seconds: 60 # Wait 60 seconds before continuing
```

```yaml
- name: waitBeforeRetry
type: wait
seconds: 60 # Wait 60 seconds before continuing
```

**See it in action:** [Request team approval](#request-team-approval) section implements full Slack approval workflow.

### Passing data between steps

**Use data passing when:** One step's output becomes another's input (the foundation of all workflows)
**Use data passing when:** One step's output becomes another's input (the foundation of all workflows)

**Key syntax:**
```yaml
# Reference previous step outputs
awsRegion: "${{ .inputs.region }}"
instanceId: "${{ .steps.getAlert.outputs.data.entity.instanceId }}"
```

```yaml
# Reference previous step outputs
awsRegion: "${{ .inputs.region }}"
instanceId: "${{ .steps.getAlert.outputs.data.entity.instanceId }}"
```

**See it in action:** All sections demonstrate data passing—each step builds on previous results.

Expand All @@ -314,7 +296,7 @@ Before building this workflow, ensure you have:
- **AWS**: Credentials with EC2 and Systems Manager permissions
- **Slack**: Bot token and channel for notifications
- **New Relic**: Alert condition monitoring EC2 CPU
- **Secrets manager**: Configured (see [secrets management](/docs/infrastructure/host-integrations/installation/secrets-management/))
- **Secrets manager**: Configured, see [secrets manager](/docs/workflow-automation/limitations-and-faq/workflow-best-practices/#secure-credentials)

### Workflow overview [#workflow-overview]

Expand All @@ -332,10 +314,10 @@ This example demonstrates key patterns you'll use in custom workflows: querying
**Skip if you're reading for concepts.** This table details the 12 parameters this workflow uses. You can reference it when building, but it's not essential for understanding the flow.
</Callout>

This workflow requires credentials, configuration, and runtime context as inputs. Sensitive values come from secrets manager using `${{ :secrets:keyName }}` syntax.
This workflow requires credentials, configuration, and runtime context as inputs. Sensitive values come from [secrets manager](/docs/workflow-automation/limitations-and-faq/workflow-best-practices/#secure-credentials) using `${{ :secrets:keyName }}` syntax.

**Input categories:**
- **Authentication**: AWS and Slack credentials from secrets manager
- **Authentication**: AWS and Slack credentials from [secrets manager](/docs/workflow-automation/limitations-and-faq/workflow-best-practices/#secure-credentials)
- **Alert context**: Account ID and issue ID from New Relic
- **Configuration**: Region, instance type, timezone, Slack channel

Expand Down Expand Up @@ -370,7 +352,7 @@ This workflow requires credentials, configuration, and runtime context as inputs
`${{ :secrets:awsAccessKeyId }}`
</td>
<td>
AWS Access Key ID retrieved from secrets manager for authenticating with AWS services.
AWS Access Key ID retrieved from [secrets manager](/docs/workflow-automation/limitations-and-faq/workflow-best-practices/#secure-credentials) for authenticating with AWS services.
</td>
</tr>
<tr>
Expand All @@ -384,7 +366,7 @@ This workflow requires credentials, configuration, and runtime context as inputs
`${{ :secrets:awsSecretAccessKey }}`
</td>
<td>
AWS Secret Access Key retrieved from secrets manager. Pairs with the access key ID.
AWS Secret Access Key retrieved from [secrets manager](/docs/workflow-automation/limitations-and-faq/workflow-best-practices/#secure-credentials). Pairs with the access key ID.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -606,7 +588,7 @@ Now let's build each part of the workflow. Each step includes the specific actio
The workflow resizes the instance through AWS Systems Manager (SSM):

* **`createSsmDocument`**: Creates an SSM Automation document that stops the instance, modifies type, and restarts it.
* **`generateIdempotencyToken`**: Creates a unique UUID. Prevents duplicate resizes if the workflow runs twice.
* **`generateIdempotencyToken`**: Creates a unique UUID to prevent duplicate resizes if the workflow runs twice.
* **`startResizing`**: Executes the SSM document with instance ID and new type.
* **`progressLoop` (Loop)**: Posts Slack updates every 10 seconds (5 times total).
* **`waitForCompletion`**: Polls SSM status with 2-minute timeout.
Expand Down
Loading
Loading