Pre-submit REST API Validation in Camunda 8 User Task Form

We have a requirement in Camunda 8 where a User Task includes a form that must be validated by calling a REST API before submission. Specifically:

  • We’re using Camunda 8 with either Camunda Forms or an embedded/external form (React/Angular/etc.).
  • Before the form is submitted, we need to call an external REST API to perform validation (e.g., check if a field value already exists in the backend).
  • If the API returns a validation error, the form submission should be blocked, and an appropriate error message should be displayed to the user.

What’s the recommended approach to implement this type of pre-submit validation in Camunda 8? Are there any best practices for handling asynchronous validation in Camunda Forms or when using an external form?

Hi @mrokka, welcome to the forums! It sounds like you are using a custom task application, in which case you would follow normal form validation steps for the framework you are using and the user experience you want to create. Once the form is validated, you would use Camunda’s API to send the data back to the process.

A custom validation via a REST endpoint is not currently supported in Camunda’s Tasklist application. You can define inline validation - such as email, min/max on numbers, is the field required, etc. - and it will display the errors on the form in Tasklist. Anything beyond that you would need to build a custom task application.

1 Like

@nathan.loding Thanks for the quick reply. We are currently working on migrating our existing BPM application to Camunda 8. In our current setup, we have full control over the page—for example, we use core JavaScript to perform validations (such as AJAX calls) before form submission and dynamically manipulate DOM elements within the form.

Since our forms are highly dynamic, we need guidance on how to achieve similar functionality in Camunda 8

@mrokka - Camunda 8 is fully API driven, so you don’t need to use our Tasklist application. You just need to utilize the API to complete the given task and send the form data along as variables. This section of our docs should have everything you need, but if there’s anything specific you’re not sure of, let me know!

1 Like