• /
  • EnglishEspañolFrançais日本語한국어Português
  • Inicia sesiónComenzar ahora

Start and schedule workflows

preview

We're still working on this feature, but we'd love for you to try it out!

This feature is currently provided as part of a preview program pursuant to our pre-release policies.

Once you've created a workflow, you can run it manually on demand or schedule it to run automatically at specific times. Both methods use the NerdGraph API to trigger workflow execution.

Choose your trigger method

Select the right approach for your use case:

Use on-demandUse scheduled
Testing new workflowsRegular health checks
Manual approval workflowsPeriodic data processing
Alert-triggered responsesDaily/weekly reports
Ad-hoc maintenance tasksScheduled maintenance windows
One-time operationsRecurring backups or cleanups

Before you begin

Before triggering workflows, ensure you have:

  • Workflow created: A workflow definition already deployed in your account (from template or custom-built).
  • Account ID: Your New Relic account ID (found in Account settings).
  • 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.

Sugerencia

New to workflows? Create your first workflow before trying to trigger it. Start with Use a template for pre-built workflows.

Run workflows on demand

Trigger workflows manually using the StartWorkflowRun API. This executes the workflow immediately with the inputs you provide.

Example: Invoke an AWS Lambda function

The following workflow definition invokes an AWS Lambda function and logs the output. Replace 12345678 with your New Relic account ID.

name: lambda1
workflowInputs:
username:
type: String
defaultValue: "User"
key:
type: String
defaultValue: "${{ :secrets:12345678:USERNAME_AWS_ACCESS_KEY_ID }}"
access:
type: String
defaultValue: "${{ :secrets:12345678:USERNAME_AWS_SECRET_ACCESS_KEY }}"
token:
type: String
defaultValue: "${{ :secrets:12345678:USERNAME_AWS_SESSION_TOKEN }}"
region:
type: String
defaultValue: us-east-1
steps:
- name: invoke1
type: action
action: aws.lambda.invoke
version: 1
inputs:
awsAccessKeyId: ${{ .workflowInputs.key }}
awsSecretAccessKey: ${{ .workflowInputs.access }}
awsSessionToken: ${{ .workflowInputs.token }}
region: ${{ .workflowInputs.region }}
functionName: hello-you
payload:
user: ${{ .workflowInputs.username }}
- name: logOutput
type: action
action: newrelic.ingest.sendLogs
version: 1
inputs:
logs:
- 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.

mutation {
workflowAutomationStartWorkflowRun(
# Specify the account where the workflow is defined
scope: { type: ACCOUNT, id: "12345678" }
# Reference the workflow definition by name
definition: { name: "lambda1" }
# Provide input values for the workflow
workflowInputs: [
{ key: "key", value: "${{ :secrets:testUser123_AWS_ACCESS_KEY_ID }}" }
{
key: "access"
value: "${{ :secrets:testUser123_AWS_SECRET_ACCESS_KEY }}"
}
{ key: "token", value: "${{ :secrets:testUser123_AWS_SESSION_TOKEN }}" }
{ key: "region", value: "us-east-2" }
{ key: "username", value: "Julien" }
]
) {
runId
}
}

Parameters explained:

  • scope: The account ID where your workflow definition is stored
  • definition: The name of the workflow to run (must match the name field in your workflow definition)
  • workflowInputs: Key-value pairs that override the default values in the workflowInputs section of your workflow definition

The mutation returns a runId (for example, 7bd25287-2af8-42e1-b783-80f4e760a40b). Use this ID to query the logs and view the output:

Workflow automation logs showing the Lambda function output

Schedule workflows

Schedule workflows to run automatically at specific times using the CreateSchedule API. Scheduled workflows run recurring tasks without manual intervention.

When to schedule workflows:

  • Regular health checks
  • Periodic data processing
  • Daily/weekly reports
  • Scheduled maintenance windows
  • Recurring backups or cleanups

Cron expression reference

Schedules use cron expressions to define when workflows run. Format: minute hour day month weekday

PatternDescriptionExample use case
0 9 * * *Every day at 9:00 AMDaily morning health checks
0 9 * * 1-5Every weekday at 9:00 AMBusiness day operations
0 */6 * * *Every 6 hoursRegular sync operations
0 0 1 * *First day of month at midnightMonthly reports
*/15 * * * *Every 15 minutesFrequent polling
0 0 * * 0Every Sunday at midnightWeekly cleanup tasks

Sugerencia

Cron syntax: * means "every", / means "every nth", - means "range". Example: 0 9 * * 1-5 = At minute 0, hour 9, every day, every month, Monday through Friday.

Example: Schedule a daily health check

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

mutation {
workflowAutomationCreateSchedule(
# Specify the account where the workflow is defined
scope: { type: ACCOUNT, id: "12345678" }
# Reference the workflow definition by name
definition: { name: "lambda1" }
# Configure the schedule
schedule: {
# Cron expression: minute hour day month weekday
# "0 9 * * *" = every day at 9:00 AM
cronExpression: "0 9 * * *"
# Timezone for the schedule
timezone: "America/New_York"
# Optional: Schedule name for identification
name: "daily-lambda-health-check"
# Optional: Add a description
description: "Runs Lambda health check every morning at 9 AM"
}
# Provide input values for the workflow
workflowInputs: [
{ key: "key", value: "${{ :secrets:testUser123_AWS_ACCESS_KEY_ID }}" }
{
key: "access"
value: "${{ :secrets:testUser123_AWS_SECRET_ACCESS_KEY }}"
}
{ key: "token", value: "${{ :secrets:testUser123_AWS_SESSION_TOKEN }}" }
{ key: "region", value: "us-east-2" }
{ key: "username", value: "HealthCheckBot" }
]
) {
scheduleId
}
}

What you get back:

  • scheduleId: Unique identifier for the schedule (use this to update or delete the schedule later)

Manage schedules

After creating a schedule:

  • View active schedules: See all scheduled runs in the workflow dashboard
  • Update schedule: Use the UpdateSchedule API to change frequency or inputs
  • Delete schedule: Use the DeleteSchedule API to stop recurring runs

For complete API documentation, see Workflow Automation APIs.

Next steps

Your workflows are running! Here's what to do next:

Monitor and manage:

Optimize for production:

Expand your workflows:

Copyright © 2025 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.