Skip to content

Commit 00a3dbb

Browse files
Merge pull request #22437 from newrelic/revert-22420-revert-22250-update-actions-catalog
Revert "Revert "Updated the actions catalog and restructured it""
2 parents 58af19f + 94f90d8 commit 00a3dbb

File tree

107 files changed

+13075
-32160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+13075
-32160
lines changed

src/content/docs/alerts/get-notified/destinations.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ The supported destination platforms include:
3030
* AWS EventBridge: Available in [workflows](/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).
3131
* PagerDuty: Available in [workflows](/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).
3232
* New Relic Mobile Push: Available in [workflows](/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).
33-
* Microsoft Teams: Available in [workflows](/docs/alerts/get-notified/microsoft-teams-integrations/).
33+
* Microsoft Teams: Available in [workflows](/docs/alerts/get-notified/microsoft-teams-integrations/).
34+
* **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.
3435

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

src/content/docs/workflow-automation/create-a-workflow-automation/create-your-own.mdx

Lines changed: 84 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ When templates don't fit your needs, [Create Your Own](https://onenr.io/0OQM47Kg
2020

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

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

2727
<Callout variant="tip">
2828
**New to workflows?** Start with core concepts, then follow the example. The EC2 workflow demonstrates all key patterns in a real-world scenario.
@@ -62,109 +62,86 @@ Understand these fundamentals before you build:
6262
<td>
6363
Inputs and secrets
6464
</td>
65-
6665
<td>
6766
Parameters for credentials and configuration
6867
</td>
69-
7068
<td>
7169
`${{ :secrets:awsKeyId }}` for credentials, `${{ .inputs.region }}` for config.
7270
</td>
7371
</tr>
74-
7572
<tr>
7673
<td>
7774
Actions (Play)
7875
</td>
79-
8076
<td>
8177
Pre-built integrations (AWS, Slack, databases, APIs)
8278
</td>
83-
8479
<td>
8580
Drag `aws.ec2.stopInstances` into workflow canvas
8681
</td>
8782
</tr>
88-
8983
<tr>
9084
<td>
9185
Data flow
9286
</td>
93-
9487
<td>
9588
Pass outputs between steps
9689
</td>
97-
9890
<td>
9991
`${{ .steps.getAlert.outputs.entityGuid }}`
10092
</td>
10193
</tr>
102-
10394
<tr>
10495
<td>
10596
Switches
10697
</td>
107-
10898
<td>
10999
Create different paths based on conditions
110100
</td>
111-
112101
<td>
113102
Route by `CPU > 90%` vs. `70-90%` vs. `< 70%`
114103
</td>
115104
</tr>
116-
117105
<tr>
118106
<td>
119-
Loops
107+
[Loops](/docs/workflow-automation/workflow-examples#loop-structure)
120108
</td>
121-
122109
<td>
123110
Process lists or poll for completion
124111
</td>
125-
126112
<td>
127113
Use `type: loop` with `for` and `in` to iterate over collections
128114
</td>
129115
</tr>
130-
131116
<tr>
132117
<td>
133118
Range
134119
</td>
135-
136120
<td>
137-
Mandatory field for loop functions to define iteration count
121+
Required parameter for loop functions to define iteration count
138122
</td>
139-
140123
<td>
141124
Use `${{ range(1, 6) }}` to loop 5 times
142125
</td>
143126
</tr>
144-
145127
<tr>
146128
<td>
147129
Wait
148130
</td>
149-
150131
<td>
151132
Pauses workflow execution for a specified duration or until a condition is satisfied
152133
</td>
153-
154134
<td>
155135
Use `type: wait` with `seconds: 60` to delay 60 seconds
156136
</td>
157137
</tr>
158-
159138
<tr>
160139
<td>
161140
Stop
162141
</td>
163-
164142
<td>
165143
Terminate workflow execution
166144
</td>
167-
168145
<td>
169146
Ends workflow after validation failures or cancellations
170147
</td>
@@ -183,7 +160,7 @@ For detailed error handling patterns, see [Best practices](/docs/workflow-automa
183160
Build your first workflow in five steps:
184161

185162
1. Navigate to **[one.newrelic.com](https://one.newrelic.com) > All Capabilities > Workflow Automation** and select **[Create Your Own](https://onenr.io/0OQM47KgxjG)**
186-
2. Define parameters for credentials (from secrets manager: `${{ :secrets:keyName }}`), configuration (regions, instance types), and runtime data (account IDs, alert IDs)
163+
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)
187164
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
188165
4. Insert switches for conditional branching, loops for processing lists or polling, approval gates for human decisions
189166
5. Run after each section to catch errors early, then [start or schedule](/docs/workflow-automation/create-a-workflow-automation/start-schedule) your workflow
@@ -201,97 +178,102 @@ Four essential patterns handle most automation scenarios. Each pattern is demons
201178
**Use switches when:** Outcomes vary based on data (threshold checks, API responses, user decisions)
202179

203180
**Key syntax:**
204-
```yaml
205-
- name: hasCompleted
206-
type: switch
207-
switch:
208-
- condition: "${{ .steps.waitForCompletion.outputs.automationExecutionStatus == 'Failed' }}"
209-
next: displayError
210-
- condition: "${{ .steps.waitForCompletion.outputs.automationExecutionStatus == 'Success' }}"
211-
next: displaySuccess
212-
next: displayUnexpected # Default path when no condition matches
213-
```
181+
```yaml
182+
- name: hasCompleted
183+
type: switch
184+
switch:
185+
- condition: "${{ .steps.waitForCompletion.outputs.automationExecutionStatus == 'Failed' }}"
186+
next: displayError
187+
- condition: "${{ .steps.waitForCompletion.outputs.automationExecutionStatus == 'Success' }}"
188+
next: displaySuccess
189+
next: displayUnexpected # Default path when no condition matches
190+
```
214191
215192
**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.
216193
217194
### Loops for processing lists
218195
219196
**Use loops when:** Processing multiple items or repeating actions
220197
198+
For detailed information about loop structure, parameters, and advanced usage (including break/continue), see [Loop structure](/docs/workflow-automation/workflow-examples#loop-structure).
199+
221200
**Key syntax:**
222-
```yaml
223-
# Send progress updates using range loop
224-
- name: progressLoop
225-
type: loop
226-
for:
227-
in: "${{ [range(1; 5)] }}" # Loop 5 times
228-
steps:
229-
- name: wait
230-
type: wait
231-
seconds: 10
232-
- name: progressMessage
233-
type: action
234-
action: slack.chat.postMessage
235-
version: 1
236-
inputs:
237-
channel: "${{ .workflowInputs.channel }}"
238-
text: "Resizing in progress..."
239-
```
201+
```yaml
202+
# Send progress updates using range loop
203+
- name: progressLoop
204+
type: loop
205+
for:
206+
in: "${{ [range(1; 5)] }}" # Loop 5 times
207+
steps:
208+
- name: wait
209+
type: wait
210+
seconds: 10
211+
- name: progressMessage
212+
type: action
213+
action: slack.chat.postMessage
214+
version: 1
215+
inputs:
216+
channel: "${{ .workflowInputs.channel }}"
217+
text: "Resizing in progress..."
218+
```
240219
241220
**See it in action:** [Execute the resize](#execute-the-resize) section uses `progressLoop` for status updates.
242221

243222
### Approval gates and waiting
244223

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

247226
**Key syntax:**
248-
```yaml
249-
- name: requestApproval
250-
type: action
251-
action: slack.chat.postMessage
252-
version: 1
253-
inputs:
254-
channel: "#approvals"
255-
text: "Approve? React with :thumbsup: or :thumbsdown:"
256-
257-
- name: getReactions
258-
type: action
259-
action: slack.chat.getReactions
260-
version: 1
261-
inputs:
262-
token: "${{ .workflowInputs.slackToken }}"
263-
channelID: "${{ .steps.requestApproval.outputs.channelID }}"
264-
threadTs: "${{ .steps.requestApproval.outputs.threadTs }}"
265-
timeout: 300 # Wait 5 minutes for reaction
266-
267-
- name: checkApproval
268-
type: switch
269-
switch:
270-
- condition: '${{ .steps.getReactions.outputs.reactions | any(.name == "+1") }}'
271-
next: handleApproval
272-
- condition: '${{ .steps.getReactions.outputs.reactions | any(.name == "-1") }}'
273-
next: handleRejection
274-
```
227+
228+
```yaml
229+
- name: requestApproval
230+
type: action
231+
action: slack.chat.postMessage
232+
version: 1
233+
inputs:
234+
channel: "#approvals"
235+
text: "Approve? React with :thumbsup: or :thumbsdown:"
236+
237+
- name: getReactions
238+
type: action
239+
action: slack.chat.getReactions
240+
version: 1
241+
inputs:
242+
token: "${{ .workflowInputs.slackToken }}"
243+
channelID: "${{ .steps.requestApproval.outputs.channelID }}"
244+
threadTs: "${{ .steps.requestApproval.outputs.threadTs }}"
245+
timeout: 300 # Wait 5 minutes for reaction
246+
247+
- name: checkApproval
248+
type: switch
249+
switch:
250+
- condition: '${{ .steps.getReactions.outputs.reactions | any(.name == "+1") }}'
251+
next: handleApproval
252+
- condition: '${{ .steps.getReactions.outputs.reactions | any(.name == "-1") }}'
253+
next: handleRejection
254+
```
275255

276256
**For simple delays:**
277-
```yaml
278-
- name: waitBeforeRetry
279-
type: wait
280-
seconds: 60 # Wait 60 seconds before continuing
281-
```
257+
258+
```yaml
259+
- name: waitBeforeRetry
260+
type: wait
261+
seconds: 60 # Wait 60 seconds before continuing
262+
```
282263

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

285266
### Passing data between steps
286267

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

289270
**Key syntax:**
290-
```yaml
291-
# Reference previous step outputs
292-
awsRegion: "${{ .inputs.region }}"
293-
instanceId: "${{ .steps.getAlert.outputs.data.entity.instanceId }}"
294-
```
271+
272+
```yaml
273+
# Reference previous step outputs
274+
awsRegion: "${{ .inputs.region }}"
275+
instanceId: "${{ .steps.getAlert.outputs.data.entity.instanceId }}"
276+
```
295277

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

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

319301
### Workflow overview [#workflow-overview]
320302

@@ -332,10 +314,10 @@ This example demonstrates key patterns you'll use in custom workflows: querying
332314
**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.
333315
</Callout>
334316

335-
This workflow requires credentials, configuration, and runtime context as inputs. Sensitive values come from secrets manager using `${{ :secrets:keyName }}` syntax.
317+
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.
336318

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

@@ -370,7 +352,7 @@ This workflow requires credentials, configuration, and runtime context as inputs
370352
`${{ :secrets:awsAccessKeyId }}`
371353
</td>
372354
<td>
373-
AWS Access Key ID retrieved from secrets manager for authenticating with AWS services.
355+
AWS Access Key ID retrieved from [secrets manager](/docs/workflow-automation/limitations-and-faq/workflow-best-practices/#secure-credentials) for authenticating with AWS services.
374356
</td>
375357
</tr>
376358
<tr>
@@ -384,7 +366,7 @@ This workflow requires credentials, configuration, and runtime context as inputs
384366
`${{ :secrets:awsSecretAccessKey }}`
385367
</td>
386368
<td>
387-
AWS Secret Access Key retrieved from secrets manager. Pairs with the access key ID.
369+
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.
388370
</td>
389371
</tr>
390372
<tr>
@@ -606,7 +588,7 @@ Now let's build each part of the workflow. Each step includes the specific actio
606588
The workflow resizes the instance through AWS Systems Manager (SSM):
607589

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

0 commit comments

Comments
 (0)