# Deploy workflow by uploading bpmn diagram

**URL:** <https://forum.camunda.io/t/deploy-workflow-by-uploading-bpmn-diagram/48809>\
**Category:** Camunda 8 Topics\
**Tags:** process-engine, zeebe\
**Created:** [November 14, 2023, 2:26pm UTC](https://forum.camunda.io/t/deploy-workflow-by-uploading-bpmn-diagram/48809 "2023-11-14T14:26:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Supriya](https://forum.camunda.io/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@Supriya](https://forum.camunda.io/u/Supriya)\
**Post date:** [November 14, 2023, 2:26pm UTC](https://forum.camunda.io/t/deploy-workflow-by-uploading-bpmn-diagram/48809/1 "2023-11-14T14:26:16Z")

</div>

Hi Team,  
i tried to deploy my bpmn diagram by using endpoint in this endpoint i am uploading my bpmn diagram under body- form-data.(key , value).  
but i am facing issue

org.springframework.core.codec.DecodingException: Could not find first boundary  
at org.springframework.http.codec.multipart.MultipartParser$PreambleState.onComplete(MultipartParser.java:321)  
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:  
Error has been observed at the following site(s):  
\*\_\_checkpoint ⇢ HTTP POST “/zeebe/process/deploy” [ExceptionHandlingWebHandler]  
Original Stack Trace:  
at org.springframework.http.codec.multipart.MultipartParser$PreambleState.onComplete(MultipartParser.java:321)

can you please help me here ?

and this is my code  
@PostMapping(“/deploy”)  
public Map\<String, Object\> deployProcesses(@RequestPart(“file”) List bpmnFiles) {  
Map\<String, Object\> response = new HashMap\<\>();

```
    try {
        if (bpmnFiles == null || bpmnFiles.isEmpty()) {
            response.put("error", "No files provided for deployment");
            return response;
        }

        for (MultipartFile bpmnFile : bpmnFiles) {
            byte[] fileBytes = bpmnFile.getBytes();
            String fileName = bpmnFile.getOriginalFilename();

            DeploymentEvent deploymentEvent = client.newDeployCommand()
                    .addResourceBytes(fileBytes, fileName)
                    .send()
                    .join();

            log.info("BPMN diagram '{}' deployed. Deployment key: {}", fileName, deploymentEvent.getKey());

            response.put("message", "BPMN diagrams deployed");
            response.put("deploymentKey", deploymentEvent.getKey());
        }
    } catch (Exception e) {
        log.error("Error deploying BPMN diagrams: {}", e.getMessage(), e);
        response.put("error", "Error deploying BPMN diagrams");
        response.put("errorMessage", e.getMessage());
    }

    return response;
}

```

---

<div class="post-metadata">

**Author:** ![rohwerj](https://forum.camunda.io/user_avatar/forum.camunda.io/rohwerj/32/33352_2.png) [@rohwerj](https://forum.camunda.io/u/rohwerj)\
**Post date:** [November 14, 2023, 8:56pm UTC](https://forum.camunda.io/t/deploy-workflow-by-uploading-bpmn-diagram/48809/2 "2023-11-14T20:56:31Z")

</div>

Hi @Supriya  
Your request to your own REST controller is not correctly formatted as spring boot can’t find the boundary for the multipart form data.  
This is still before actually doing the deploy with the Zeebe client.  
Have a look at

> <https://stackoverflow.com/questions/36005436/the-request-was-rejected-because-no-multipart-boundary-was-found-in-springboot>
