Skip to content

Workflows

In Azure Logic Apps Automation, a workflow is an automation workload that begins with an event (trigger), followed by the tasks you want to perform (actions). Workflows exist inside apps and support expressions, IntelliSense, inline code execution such as JavaScript, and more.

You build a workflow by using the designer or the AI workflow assistant. The platform’s runtime executes the workflow.

To get started, see Quickstart.

Azure Logic Apps Automation currently supports only stateful workflows. These workflows keep their full run history information for diagnostics and governance, and they support replay, retry, and long-running operations. Stateless workflows run only inside memory and optimize for short, fast executions.

Here are some example triggers that can start a workflow:

Trigger groupTriggerDescription
ScheduleRecurrenceRun on a schedule like every minute, hour, day, or based on a cron expression.
RequestWhen an HTTP request is receivedRun when an HTTP or HTTPS request arrives from an external caller. (non-polling)
Managed connectorsOutlook, SharePoint, Salesforce, and so onRun when an event happens like When a new email arrives or When a new file is uploaded. Hosted and run in global Azure, usually requires a connection, and often with polling on a schedule.

Here are some example actions that can run in a workflow:

Action groupActionDescription
HTTPHTTPSend generic REST calls like GET or POST.
Control- Condition
- Switch
- For each
- Until
Change the flow based on meeting specific criteria.
Data Operations- Compose
- Parse JSON
- Select
- Filter array
- Join
Perform data shaping.
Variables- Initialize variable
- Set variable
- Increment variable
- Decrement variable
Store and manage variable values.
Inline CodeExecute JavaScript codeRun code snippets inline with your workflow.
Service provider-basedService Bus, Azure Blob Storage, Azure QueuesRun service-based operations natively and directly on the platform’s runtime.
Managed connectorsOutlook, SharePoint, Salesforce, and so onPerform a task like Send an email or Upload a file. Run in global multitenant Azure. Usually requires a connection.
AgentsAI-driven actions with a system prompt and a toolset.

Trigger and action parameters accept literal values and calculated values. For calculated values, use an expression to call prebuilt functions by using the platform’s expression language. The same expression syntax works wherever you can specify a value, for example, in parameters, conditions, loops, and agent system prompts.

Here are some example expressions, which always start with the @ character when you work with the underlying JSON, but aren’t required when you work with the designer:

@add(triggerBody()?.num1, 5)

@formatDateTime(utcNow(), 'yyyy-MM-dd')

@if(empty(variables('orders')), 'none', 'present')

Action parameters also accept dynamic output from preceding steps in the same workflow. The designer lets you select this output wherever you can specify a value. In the underlying JSON, this output appears as expressions such as @triggerBody() and outputs('<action-name').

For logic that’s hard to represent as an expression, add and run JavaScript by using the Inline Code action named Execute JavaScript code. For example, you might need to use code for tasks such as string parsing, complex data shaping, and multistep calculation. The JavaScript action runs in a sandbox with the Node.js runtime, accepts JSON inputs from the workflow, and returns a value that subsequent workflow actions can use.

// Action: Inline JavaScript Code
const orders = workflowContext.actions.Fetch_Orders.outputs.body;
return orders
.filter(o => o.total > 100)
.map(o => ({ id: o.id, customer: o.customerName, total: o.total }));

Every workflow has a draft version and a published version. You always edit the draft version, while the read-only published version runs in the production environment and interacts with real, actual traffic.

The following table provides more information about draft versus published mode:

BehaviorDraftPublished
What is itYour in-progress editsThe live, read-only version where the trigger fires against real, actual events
Where edits goAutomatically saved while you workUpdated only when you publish
IdentifierDraft labelPublished label
Run historyAppears in the Version section under Drafts in monitoring viewAppears in the Version section under Published in monitoring view

For triggers that work in draft mode, you can experiment and quickly iterate by running workflows on demand before you publish. Here’s the rules for testing triggers:

  • You can test any trigger that you can manually run.

    This rule means you can iterate quickly on Request-based trigger workflows, and then publish after everything works as expected.

  • You can only run time-based or event-based triggers in published mode.

    To test a non-Request trigger, publish your workflow first.

The following table describes common example triggers that run in draft versus published mode:

Trigger typeTrigger nameTest in draft?How to test
RequestWhen an HTTP request is receivedYesOn the bottom designer toolbar, select Test, and provide a sample payload.
ScheduleRecurrenceNo, must publishPublish, and then wait for the scheduled time, or shorten the schedule.
Event-driven, such as Service Bus, Event Hubs, Azure QueuesVariesNo, must publishPublish, and then push an event to the target resource.
Polls a service or system endpointVariesNo, must publishPublish, and then trigger the event in the target service or system.

The platform provides a code view where you can edit the workflow’s underlying JSON definition. The designer uses this same JSON definition, which stays synchronized with the code editor. The code editor is the same and is available everywhere that code appears, such as the workflow code view, inline code actions, and expression editor.

The editor offers the following capabilities:

CapabilityDescription
IntelliSense (auto-complete)Start typing in the editor to view matching action types, expression functions, and known properties from the workflow schema. To display the popup, press Ctrl + Space or ⌃ Space.
Function signature helpStart typing the function name to view the signature and parameter information.
Parameter helpMove your mouse pointer over a parameter to view the type and description.
Schema-aware validation and diagnosticsFind invalid action types, malformed expressions, and missing required parameters, which appear underlined with a tooltip about the problem.