create_flow
Creates a Power Automate flow from a workflow definition containing triggers and actions, with optional start. Use it to turn JSON definitions into runnable flows and surface missing connections.
Instructions
Create a flow from a workflow-definition dict.
definition is the same JSON the designer shows under Code view. It needs
at least triggers and actions.
TWO RULES LEARNED THE HARD WAY:
Declare the magic parameters. If any trigger or action uses a connector (type OpenApiConnection / OpenApiConnectionWebhook / ...Notification), the definition must carry, at top level next to triggers and actions: "parameters": { "$connections": {"defaultValue": {}, "type": "Object"}, "$authentication": {"defaultValue": {}, "type": "SecureObject"} } Without them creation 400s complaining that the TRIGGER is missing '$authentication', which sends you hunting in the wrong place. Harmless to include on connector-free flows, so just always include it.
Creating does not bind connections. A 201 gives you a flow whose connectionReferences is {} and which will not start ("CannotStartUnpublishedSolutionFlow"). For connector flows the working sequence is create(start=False) -> update_flow_definition(with connection_references) -> a start call. Connector-free flows (Recurrence, Request, Compose, HTTP) start immediately, which is why the demo flow uses those.
If the environment has no Connected connection for a connector the definition
uses, the result carries missing_connections: [{connector, create_url}]. Show
the user create_url - the portal Connections page, where + New connection creates
it - then call bind_connection once they have signed in.
Never inline a secret in a definition - it is stored in plaintext on the flow artifact. Use a Power Platform environment variable or Key Vault reference.
Look up connector operationIds and parameter keys rather than guessing them.
Guessing produces a flow that saves fine and fails at runtime. With the Microsoft
Learn MCP server connected: microsoft_docs_search, then microsoft_docs_fetch on
https://learn.microsoft.com/connectors// (large, so search first).
That page marks deprecated operations. Where a parameter is typed dynamic it
stops at the top-level key - copy the nested shape from get_flow on a working flow.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"display_name": "<display_name>",
"definition": "<definition>"
},
"name": "create_flow"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start | No | ||
| definition | Yes | ||
| display_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | ||
| actions | No | ||
| flow_id | No | ||
| modified | No | ||
| triggers | No | ||
| warnings | No | ||
| definition | No | ||
| display_name | No | ||
| missing_connections | No | ||
| previous_definition | No |