Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 @@ -134,7 +134,7 @@ Understand these fundamentals before you build:
</td>

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

<td>
Expand Down Expand Up @@ -183,7 +183,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/#use-secrets-manager): `${{ :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 Down Expand Up @@ -242,7 +242,7 @@ Four essential patterns handle most automation scenarios. Each pattern is demons

### 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
Expand Down Expand Up @@ -314,7 +314,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/#use-secrets-manager))

### Workflow overview [#workflow-overview]

Expand All @@ -332,10 +332,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/#use-secrets-manager) 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/#use-secrets-manager)
- **Alert context**: Account ID and issue ID from New Relic
- **Configuration**: Region, instance type, timezone, Slack channel

Expand Down Expand Up @@ -370,7 +370,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/#use-secrets-manager) for authenticating with AWS services.
</td>
</tr>
<tr>
Expand All @@ -384,7 +384,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/#use-secrets-manager). Pairs with the access key ID.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -606,7 +606,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
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Before triggering workflows, ensure you have:
- **Account ID**: Your New Relic account ID (found in [Account settings](/docs/accounts/accounts-billing/account-structure/account-id)).
- **Workflow name**: The exact name from your workflow definition.
- **Required inputs**: Values for any parameters your workflow expects.
- **Secrets configured**: AWS credentials, Slack tokens, or other secrets stored in [secrets manager](/docs/infrastructure/host-integrations/installation/secrets-management/).
- **Secrets configured**: AWS credentials, Slack tokens, or other secrets stored in [secrets manager](/docs/workflow-automation/limitations-and-faq/workflow-best-practices/#use-secrets-manager).

<Callout variant="tip">
**New to workflows?** Create your first workflow before trying to trigger it. Start with [Use a template](/docs/workflow-automation/create-a-workflow-automation/use-a-template) for pre-built workflows.
Expand Down Expand Up @@ -95,9 +95,9 @@ The following workflow definition invokes an AWS Lambda function and logs the ou
- message: 'The lambda function message output is:${{ .steps.invoke1.outputs.payload.body }}'
```

To start this workflow, use the following NerdGraph mutation. Before running this mutation, ensure you've stored your AWS credentials using the `secretsManagementCreateSecret` mutation. For more information, see [Introduction to secrets management](/docs/apis/nerdgraph/examples/nerdgraph-secrets-management).
To start this workflow, use the following NerdGraph mutation. Before running this mutation, ensure you've stored your AWS credentials using the `secretsManagementCreateSecret` mutation. For more information, see [secrets manager](/docs/workflow-automation/limitations-and-faq/workflow-best-practices/#use-secrets-manager).

```graphql
```yaml
mutation {
workflowAutomationStartWorkflowRun(
# Specify the account where the workflow is defined
Expand Down Expand Up @@ -165,7 +165,7 @@ Schedules use cron expressions to define when workflows run. Format: `minute hou

The following example schedules the `lambda1` workflow to run every day at 9 AM Eastern Time:

```graphql
```yaml
mutation {
workflowAutomationCreateSchedule(
# Specify the account where the workflow is defined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Store all sensitive values in New Relic's secrets manager. Never hardcode creden

Store AWS credentials, API tokens, and passwords:

```graphql
```yaml
mutation {
secretsManagementCreateSecret(
scope: {type: ACCOUNT id: "YOUR_NR_ACCOUNT_ID"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,22 @@ freshnessValidatedDate: never
<td>50KB</td>
</tr>
<tr>
<td>No of Workflow definitions (Including all versions)</td>
<td>No of Workflow definitions at account level(excluding versions count)</td>
<td></td>
<td>1000</td>
</tr>
<tr>
<td>No of Workflow definitions at org level (including all versions)</td>
<td>No of Workflow definitions at org level (excluding versions count)</td>
<td></td>
<td>1000</td>
</tr>
<tr>
<td>No of versions per workflow definition at account level</td>
<td></td>
<td>1000</td>
</tr>
<tr>
<td>No of versions per workflow definition at org level</td>
<td></td>
<td>1000</td>
</tr>
Expand All @@ -67,7 +77,7 @@ freshnessValidatedDate: never
<tr>
<td>Length of a workflow input value</td>
<td></td>
<td>1000 characters</td>
<td>1000 Characters</td>
</tr>
<tr>
<td>Workflow concurrent runs (per account)</td>
Expand Down
Loading
Loading