i am testing a simple logic app that translates multiple files into english. when I run one file through it, it is very good quality but when i run multiple files the translation is absolutely trash. The test file I am using is a UN paper so I can compare the quality of the translations; original, good, trash. This is my logic app code
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each": {
"type": "Foreach",
"foreach": "@body('Lists_blobs_(V2)')?['value']",
"actions": {
"Check_if_PDF": {
"type": "If",
"expression": {
"and": [
{
"equals": [
"@items('For_each')?['MediaType']",
"application/pdf"
]
}
]
},
"actions": {
"Start_document_translation": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"referenceName": "microsofttranslatorv"
}
},
"method": "post",
"body": {
"storageType": "Folder",
"sourceURL": "https://equablobmain.blob.core.windows.net/test-translate-arabic?si=test-translate&spr=https&sv=2022-11-02&sr=c&sig=%2BrZRDITWB%2BxjCbIp2XezHIR7xWpYajxg7IEWbpjDECU%3D",
"targetContainerURL": "https://equablobmain.blob.core.windows.net/test-translate-en?si=test-translate&spr=https&sv=2022-11-02&sr=c&sig=L9IZV7HhJ4CB27bZWbff0Vk1%2FUc5ZAqVgR38OYoIs2A%3D",
"targetLanguage": "en",
"sourceLanguage": "ar"
},
"headers": {
"Content-Type": "application/json"
},
"path": "/translator/text/batch/v1.1/batches/"
},
"runAfter": {
"Analyze_Layout": [
"SUCCEEDED"
]
}
},
"Analyze_Layout": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"referenceName": "formrecognizer"
}
},
"method": "post",
"headers": {
"inputFileUrl": "@concat('https://equablobmain.blob.core.windows.net/test-translate-arabic/', items('For_each')?['Name'], '?sp=rl&st=2025-01-25T18:53:32Z&se=2025-01-30T02:53:32Z&spr=https&sv=2022-11-02&sr=c&sig=Xnh5XK1WWmvahq%2BsyrLKFl8BBLLTjbAIhP1v6QIg%2FWE%3D')",
"Content-Type": "application/json"
},
"path": "/v2.1/layout/analyze"
}
}
},
"else": {
"actions": {
"Start_document_translation_1": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"referenceName": "microsofttranslatorv"
}
},
"method": "post",
"body": {
"storageType": "Folder",
"sourceURL": "https://equablobmain.blob.core.windows.net/test-translate-arabic?si=test-translate&spr=https&sv=2022-11-02&sr=c&sig=%2BrZRDITWB%2BxjCbIp2XezHIR7xWpYajxg7IEWbpjDECU%3D",
"targetContainerURL": "https://equablobmain.blob.core.windows.net/test-translate-en?si=test-translate&spr=https&sv=2022-11-02&sr=c&sig=L9IZV7HhJ4CB27bZWbff0Vk1%2FUc5ZAqVgR38OYoIs2A%3D",
"targetLanguage": "en",
"sourceLanguage": "ar"
},
"headers": {
"Content-Type": "application/json"
},
"path": "/translator/text/batch/v1.1/batches/"
}
}
}
}
}
},
"runAfter": {
"Lists_blobs_(V2)": [
"Succeeded"
]
}
},
"Lists_blobs_(V2)": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"referenceName": "azureblob"
}
},
"method": "get",
"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('AccountNameFromSettings'))}/foldersV2/@{encodeURIComponent(encodeURIComponent('test-translate-arabic'))}"
},
"runAfter": {},
"metadata": {
"JTJmdGVzdC10cmFuc2xhdGUtYXJhYmlj": "/test-translate-arabic"
}
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"triggers": {
"When_a_blob_is_added_or_updated": {
"type": "ServiceProvider",
"inputs": {
"parameters": {
"path": "https://equablobmain.blob.core.windows.net/test-translate-arabic"
},
"serviceProviderConfiguration": {
"connectionName": "AzureBlob-1",
"operationId": "whenABlobIsAddedOrModified",
"serviceProviderId": "/serviceProviders/AzureBlob"
}
}
}
}
},
"kind": "Stateful"
}