pnp / pnp/cli-microsoft365

New command: `m365 flow set`

Open
#6,975 7 comments 0 reactions 1 assignee View on GitHub

@mkm17 is already working on this.

Since May 23, 2026.

feature request work in progress
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

Usage

m365 flow set [options]

Description

Sets the specified Power Automate flow

Options
Option Description
-n, --name <name> The name of the Power Automate flow to update.
-e, --environmentName <environmentName> The name of the environment that contains the flow.
--definition <definition> A JSON string containing the new flow definition to set.
--publish Publishes the flow.
-f, --force Don't prompt for confirmation when warnings occur.
Examples

Set a new definition for the specified flow and save it as a draft

m365 flow set --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --definition '{\"properties\":{\"definition\":{\"$schema\":\"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#\",\"actions\":{\"Compose\":{\"type\":\"Compose\",\"inputs\":\"test\",\"runAfter\":{},\"metadata\":{\"operationMetadataId\":\"4f25ab1c-549e-4eaf-9980-c03020e55378\"}}},\"parameters\":{\"$authentication\":{\"defaultValue\":{},\"type\":\"SecureObject\"}},\"triggers\":{\"manual\":{\"type\":\"Request\",\"kind\":\"Button\",\"inputs\":{\"schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},\"metadata\":{\"operationMetadataId\":\"1b2caf01-8e22-45eb-8646-77168ad14bdd\"}}},\"contentVersion\":\"1.0.0.0\",\"outputs\":{}},\"connectionReferences\":{},\"displayName\":\"Test Flow\",\"templateName\":\"\",\"environment\":{\"name\":\"Default-d87a7535-dd31-4437-bfe1-95340acd55c5\"}}}'

Set a new definition for the specified flow and publish it

m365 flow set --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --definition '{\"properties\":{\"definition\":{\"$schema\":\"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#\",\"actions\":{\"Compose\":{\"type\":\"Compose\",\"inputs\":\"test\",\"runAfter\":{},\"metadata\":{\"operationMetadataId\":\"4f25ab1c-549e-4eaf-9980-c03020e55378\"}}},\"parameters\":{\"$authentication\":{\"defaultValue\":{},\"type\":\"SecureObject\"}},\"triggers\":{\"manual\":{\"type\":\"Request\",\"kind\":\"Button\",\"inputs\":{\"schema\":{\"type\":\"object\",\"properties\":{},\"required\":[]}},\"metadata\":{\"operationMetadataId\":\"1b2caf01-8e22-45eb-8646-77168ad14bdd\"}}},\"contentVersion\":\"1.0.0.0\",\"outputs\":{}},\"connectionReferences\":{},\"displayName\":\"Test Flow\",\"templateName\":\"\",\"environment\":{\"name\":\"Default-d87a7535-dd31-4437-bfe1-95340acd55c5\"}}}' --publish
Default properties
Additional Info

Hi,

I noticed that before adding or updating a flow, two calls are made: checkFlowWarnings and checkFlowErrors. I think it’s worth checking the status of warnings and errors before updating the flow. Maybe, in case of a warning, we could prompt the user for confirmation.

Let me know what you think about this command. I’d also like to add a flow add command with a similar structure.

Minimal permissions

Azure Service Management/user_impersonation delegated

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.