Introduction
Azure Logic Apps workflows are defined in JSON format following a specific schema. When the workflow definition has syntax errors, missing required fields, or invalid action configurations, the workflow fails to save or run.
Symptoms
Workflow save error:
{
"error": {
"code": "WorkflowDefinitionInvalid",
"message": "The workflow definition is invalid. Property 'actions' must be an object"
}
}Schema validation error:
{
"error": {
"code": "InvalidWorkflowDefinition",
"message": "Action 'Send_Email' is missing required property 'inputs'"
}
}Trigger configuration error:
```bash $ az logicapp workflow create \ --name my-workflow \ --resource-group my-rg \ --definition @workflow.json
"Error: The trigger 'Recurrence' has invalid 'recurrence' configuration" ```
Common Causes
- 1.JSON syntax error - Missing braces, quotes, or commas
- 2.Invalid action type - Unknown or deprecated action type
- 3.Missing required fields - Inputs, type, or kind missing
- 4.Expression syntax error - Invalid workflow expression syntax
- 5.Invalid trigger config - Wrong recurrence or polling settings
- 6.Schema version mismatch - Using outdated schema version
- 7.Duplicate action names - Two actions with same name
Step-by-Step Fix
- 1.Check logs for specific error messages
- 2.Verify configuration settings
- 3.Test network connectivity
- 4.Review recent changes
- 5.Apply corrective action
- 6.Verify the fix
Step 1: Validate JSON Syntax
```bash # Check JSON syntax locally cat workflow.json | jq empty
# If jq reports error, fix syntax issues # Common issues: # - Missing closing braces # - Unclosed quotes # - Missing commas between elements
# Validate with Azure CLI az logicapp workflow validate \ --definition @workflow.json ```
Step 2: Check Workflow Definition Schema
```json // Correct workflow definition structure { "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", "contentVersion": "1.0.0.0", "parameters": {}, "triggers": {}, "actions": {}, "outputs": {} }
// Verify schema version is current az logicapp workflow show \ --name my-workflow \ --resource-group my-rg \ --query 'properties.definition.$schema' ```
Step 3: Validate Trigger Configuration
```bash # Check trigger configuration az logicapp workflow show \ --name my-workflow \ --resource-group my-rg \ --logic-app-name my-logic-app \ --query 'properties.definition.triggers'
# Valid recurrence trigger: { "triggers": { "Recurrence": { "type": "Recurrence", "recurrence": { "frequency": "Day", "interval": 1 } } } }
# Fix invalid frequency values # Valid values: Second, Minute, Hour, Day, Week, Month, Year ```
Step 4: Validate Action Definitions
```bash # Check action definitions az logicapp workflow show \ --name my-workflow \ --resource-group my-rg \ --logic-app-name my-logic-app \ --query 'properties.definition.actions'
# Each action must have: # - "type": valid action type # - "inputs": action-specific inputs # - "runAfter": dependencies (optional)
# Valid action types: # - Http, HttpWebhook # - Office365, Outlook # - ServiceBus, EventGrid # - Wait, Condition, Foreach, Until ```
Step 5: Fix Expression Syntax Errors
```bash # Invalid expression examples: # "@body('Send_Email')" - correct # "@body(Send_Email)" - missing quotes around action name # "@triggerBody()" - correct # "@trigger.body()" - invalid dot notation
# Test expressions in Azure Portal: # Logic App Designer > Expression editor
# Common expression patterns: # @triggerBody()?['property'] - safe null handling # @coalesce(body('action1'), body('action2')) - fallback # @length(items('foreach')) - count iterations ```
Step 6: Check for Duplicate Names
```bash # Extract all action names az logicapp workflow show \ --name my-workflow \ --resource-group my-rg \ --logic-app-name my-logic-app \ --query 'properties.definition.actions | keys(@)'
# Each action name must be unique # Rename duplicates: # "Send_Email" -> "Send_Email_1" # "Send_Email" -> "Send_Email_2" ```
Step 7: Validate Connections
```bash # Check API connections referenced in actions az resource list \ --resource-group my-rg \ --resource-type Microsoft.Web/connections \ --query '[].name'
# Connection reference format in workflow: { "inputs": { "host": { "connection": { "referenceName": "office365-connection" } } } }
# If connection missing, create it: az logicapp connection create \ --name office365-connection \ --resource-group my-rg \ --connection-type office365 ```
Step 8: Use Workflow Designer for Debugging
```bash # Azure Portal provides visual validation: # 1. Open Logic App # 2. Click "Logic App Designer" # 3. Errors shown with red indicators # 4. Click error for specific issue
# Export corrected workflow: # Designer > Code View > Copy JSON ```
Step 9: Fix Parameter Definitions
```bash # Check workflow parameters az logicapp workflow show \ --name my-workflow \ --resource-group my-rg \ --logic-app-name my-logic-app \ --query 'properties.definition.parameters'
# Valid parameter format: { "parameters": { "emailAddress": { "type": "string", "defaultValue": "admin@example.com" } } }
# Reference in actions: "@parameters('emailAddress')" ```
Step 10: Validate Outputs
```bash # Check output definitions az logicapp workflow show \ --name my-workflow \ --resource-group my-rg \ --logic-app-name my-logic-app \ --query 'properties.definition.outputs'
# Valid output format: { "outputs": { "result": { "type": "string", "value": "@body('final_action')" } } }
# Output type must match value expression result ```
Common Action Type Validations
| Action Type | Required Inputs |
|---|---|
| Http | method, uri, headers |
| Office365.Email | to, subject, body |
| ServiceBus.Send | queueName, message |
| Wait | duration or until |
| Condition | expression, actions |
| Foreach | foreach (array), actions |
Verification
```bash # After fixing workflow definition az logicapp workflow create \ --name my-workflow \ --resource-group my-rg \ --logic-app-name my-logic-app \ --definition @workflow-fixed.json
# Verify workflow saved az logicapp workflow show \ --name my-workflow \ --resource-group my-rg \ --logic-app-name my-logic-app \ --query 'properties.state'
# Should show "Enabled"
# Test workflow az logicapp workflow invoke \ --name my-workflow \ --resource-group my-rg \ --logic-app-name my-logic-app ```
Prevention
To prevent Azure Logic App workflow definition invalid issues from recurring, implement these proactive measures:
1. Validate Workflows Before Deployment
```bash # Pre-commit validation script cat << 'EOF' > validate_workflow.sh #!/bin/bash WORKFLOW_FILE=$1
# Check JSON syntax jq . $WORKFLOW_FILE > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "ERROR: Invalid JSON syntax" exit 1 fi
# Check required structure jq -e '.definition."$schema"' $WORKFLOW_FILE > /dev/null if [ $? -ne 0 ]; then echo "ERROR: Missing definition schema" exit 1 fi
# Validate triggers exist jq -e '.definition.triggers' $WORKFLOW_FILE > /dev/null if [ $? -ne 0 ]; then echo "ERROR: No triggers defined" exit 1 fi
echo "Workflow definition valid" EOF
chmod +x validate_workflow.sh ```
2. Use ARM Templates for Deployment
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"resources": [
{
"type": "Microsoft.Logic/workflows",
"apiVersion": "2019-05-01",
"name": "my-workflow",
"properties": {
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"triggers": {},
"actions": {}
}
}
}
]
}3. Version Control Workflows
```bash # Export workflow to file az logicapp workflow show \ --name my-workflow \ --resource-group my-rg \ --logic-app-name my-logic-app \ --query 'properties.definition' \ -o json > workflow-definition.json
# Commit to git git add workflow-definition.json git commit -m "Update workflow definition"
# Use branches for changes # Review changes before merging ```
Best Practices Checklist
- [ ] Validate workflows before deployment
- [ ] Use ARM templates for consistency
- [ ] Version control workflow definitions
- [ ] Test in development environment first
- [ ] Document workflow logic
- [ ] Review connector compatibility
Related Issues
- [Fix Azure Logic App Connector Auth Failed](/articles/fix-azure-logic-app-connector-auth-failed)
- [Fix Azure Logic App Run History Missing](/articles/fix-azure-logic-app-run-history-missing)
- [Fix Azure API Connection Not Working](/articles/fix-azure-api-connection-not-working)
Related Articles
- [Technical troubleshooting: Fix Azure Aks Pod Crashloopbackoff Issue in Azure](azure-aks-pod-crashloopbackoff)
- [Technical troubleshooting: Fix Azure Api Management Policy Expression Runtime](azure-api-management-policy-expression-runtime-error)
- [Technical troubleshooting: Fix Azure App Configuration Feature Flag Not Refre](azure-app-configuration-feature-flag-not-refreshing)
- [Technical troubleshooting: Fix Azure App Service 503 Always On Disabled Issue](azure-app-service-503-always-on-disabled)
- [Technical troubleshooting: Fix Azure Application Gateway Err SSL Unrecognized](azure-application-gateway-err-ssl-unrecognized-name-alert)
<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "TechArticle", "headline": "Fix Azure Logic App Workflow Definition Invalid", "description": "Troubleshoot Logic App workflow definition errors. Fix JSON schema issues, action configurations, and trigger settings.", "url": "https://www.fixwikihub.com/fix-azure-logic-app-workflow-definition-invalid", "publisher": { "@type": "Organization", "name": "FixWikiHub", "url": "https://www.fixwikihub.com" }, "author": { "@type": "Person", "name": "FixWikiHub Editorial Team" }, "datePublished": "2026-04-03T05:30:38.345Z", "dateModified": "2026-04-03T05:30:38.345Z" } </script>