--- alias: user-guide-automation-task-mes-recipeuploadrequest tags: - automation tasks description: "This task handles recipe upload requests from the MES system, retrieving and emitting the recipe body" --- # Recipe Upload Request :iot-recipebodyrequested-lg:{style="font-size:100px"} This task implements Recipe Upload Requests from the MES system. When triggered, it subscribes to the configured system event subject, receives an upload request from the MES, retrieves the corresponding recipe details (name, body, and format) from the MES, and emits them as outputs for downstream processing. ![Connect IoT Recipe Upload Request Task](./images/recipeUploadRequest-task.png) ## Workflows | Data Flow | Control Flow | | :--------: | :---------: | | :material-check:{ style="color: #4DB6AC" } | :material-check:{ style="color: #4DB6AC" } | ## Inputs | Name | Data Type | Description | | -------------- | --------- | --------------------------------------------------------------------------- | | Enable/Disable | `Boolean` | Activates or deactivates the event listener. Defaults to `true` (enabled). | | Subject | `String` | The system event subject to subscribe to for recipe upload requests. | | Reply Timeout (ms) | `Integer` | Maximum time (in milliseconds) to wait for a reply before timing out. | ## Outputs | Name | Data Type | Description | | ------------- | --------- | ------------------------------------------------------------------------ | | Recipe Name | `String` | The name of the recipe requested for upload to the equipment. | | Body | `Any` | The recipe body content (text or binary) to be sent to the equipment. | | IsBinary | `Boolean` | Indicates whether the recipe body is in binary format. | | Success | `Boolean` | Triggered when a recipe upload request is successfully received. | | Error | `Error` | Triggered when the task fails for some reason. | ## Settings On the `General` tab, you have the usual settings and the following settings: | Name | Data Type | Default | Description | | --------------------- | --------- | ---------------------------------- | ---------------------------------------------------------------------------------------------- | | Auto Enable | `Boolean` | `true` | Automatically activates the event listener when the task is initialized. | | Reply Timeout (ms) | `Integer` | `60000` | Amount of time (in milliseconds) allowed to wait for a reply before issuing a timeout. | | Recipe Upload Request | `String` | `RecipeManagement.UploadRecipe` | Subject used to communicate with the MES for recipe upload requests. This field is read-only. | ![Connect IoT Recipe Upload Request Task](./images/recipeUploadRequest-settings.png) ## Behavior This task listens for Recipe Upload Requests from the MES and emits the **Recipe** details as outputs for downstream processing by an IoT Workflow to upload the recipe to the equipment. It supports two execution modes: - **Data Flow**: Emits `Recipe Name`, `Body`, and `IsBinary` outputs so that a downstream [Send Recipe Upload Reply](task_recipeUploadReply.md) task can send the result back to the MES. A timeout is enforced while waiting for the reply. - **Control Flow**: Runs a single attached branch each time a request is received, passing the recipe data as output properties. The branch has a configurable timeout. ## Remarks {% include-markdown 'includes/pages/automation_zones_note.md' %} In **Data Flow** mode, pair this task with the [Send Recipe Upload Reply](task_recipeUploadReply.md) task to complete the request/reply cycle. In **Control Flow** mode, the task must have exactly one branch configured.