Skip to main content

Creating new workflows

You can create workflows using our low code UI or by writing the workflow configuration directly.

Workflows are versioned no matter how they're created and edited. You can see the entire version history of a workflow at any time, including the users that ran through specific versions.

You can create new workflows in one of two ways:

  1. Using our low code UI, which guides you through the entire workflow process from start to end and writes code for you.
  2. Writing workflow code directly, which grants maximum control over your workflow. We have a CLI which aids you through the process of writing, validing, and publishing workflows.

Via the low-code UI

Our low code UI allows you to create workflows from scratch in just 2 minutes, with no prior knowledge of the system:

  1. Select "workflows" from the navigation menu
  2. Hit the "New workflow" button in the top right corner
Creating a workflow from the UIHit "workflows", then New from the top right to create a new workflow.
  1. Choose the type of workflow you'd like to make. Event workflows trigger on events, and scheduled worfklows run on a schedule.

    a. For event workflows, type in the name of the event that should trigger this workflow. The autocomplete utility will show you all received events. If you want another event to trigger the workflow type the name in and ignore the autocomplete.

    b. For scheduled workflows, add a cron expression for the schedule. This website can help you with your expressions.

  2. From there, you'll see our workflow editor. Click the "add" button to add new actions that run within your workflow.

Creating a workflow from the UIAdd and customize actions within your workflow.
  1. Create your workflow by adding and configuring your actions, then hit "Save draft" to save the draft or "Publish workflow" to push the workflow live.
  2. You can also test the workflow by hitting "Run" below the save action. Paste the event data that will trigger the workflow on the left, and hit "Run" from the debug bar to preview your workflow.

Via code

Workflows are represented as code using the cue configuration language. For full control, you can write this workflow definition code directly.

You can use the Inngest CLI to create, validate, and publish workflows from the command line.

Note that creating workflows via the UI also writes the associated configuration code for you automatically. You can use the UI as a starting point to discover how workflow configuration works visually.

Example workflow code

A basic workflow which is triggered via an event has the following definition:

package main

import (
"inngest.com/workflows"
)

// Define the workflow
workflow: workflows.#Workflow & {

// Each workflow has a name
name: "worky mcworkflowface"

// And each workflow has triggers. This example uses an event trigger, although
// you can also use cron triggers: [{ cron: "*/15 * * * *" }]
triggers: [{
event: "test.event"
}]

// actions define the code that runs within the workflow
actions: [{
clientID: 1
name: "Say hello"
dsn: "com.inngest/http"
metadata: {
authMethod: "none"
authValues: {}
duration: "18h"
headers: []
method: "POST"
payload: "Hello! Here's my event: \"{{ event.name }}\""
type: "for"
url: "http://www.example.com"
}
}]

// edges define the order in which code runs.
edges: [{
outgoing: "trigger"
incoming: 1
metadata: {
type: "edge"
name: ""
// If allows you to define expressions that must evaluate to
// true in order for this edge to be traversed. These expressions
// can see the entire workflow baggage, including the event and each
// action's responses.
if: ""
}
}]
}