Run form in the background API


Since Orbeon Forms 2017.2.

This is an Orbeon Forms PE feature.


The purpose of this service is to run a form definition, either in "new" mode or in "edit" mode, but in the background, optionally running one or more processes in addition to the regular execution of the form.

This allows scenarios such as:

  • create new form data in the database

  • read, modify and update existing form data


  • URLs:

    • /fr/service/$app/$form/new

    • /fr/service/$app/$form/edit/$document

  • Method: POST

Optional request body when using /new:

When not POSTing any XML data, just POST an empty request body to the service.

Response body:

  • Content-Type: application/xml

  • contains

    • the newly created or existing document id

    • whether all processes were successful

Example response body:

<?xml version="1.0" encoding="UTF-8"?>

Returning form data

[SINCE Orbeon Forms 2021.1]

This must first be enabled with the following property:


Then, if you pass the URL parameter return-data=true to the service, form data is returned:


By default, the data is returned in the 4.0.0 data format. You can override this by passing the data-format-version parameter:

  • data-format-version

    • edge: send the data in the latest internal format

    • 2019.1.0: send the data in the Orbeon Forms 2019.1-compatible format

    • 4.8.0: send the data in the Orbeon Forms 4.8-compatible format

    • 4.0.0: send the data in the Orbeon Forms 4.0-compatible format (the default)

The prune-metadata parameter can be used to control production of metadata:

  • true to remove all occurrences of fr:-prefixed elements and attributes

  • false to leave such occurrences

  • default

    • false when data-format-version is set to edge

    • true otherwise

Running processes

The following property controls what process(es) to run:

where $app and $form represent a Form Runner application name and/or form name or * wildcards, as is usual with Form Runner configuration properties.

The following example saves new instance data to the database when the service is called with /fr/service/$app/$form/new:


The following example updates existing instance data with the current time and saves it to the database when the service is called with /fr/service/$app/$form//edit/$document, where $document represents an existing form data document id:

xf:setvalue(ref ="//current-time", value = "current-dateTime()") then save

For detail on the process names and more, see Running processes upon page load .

Example: validate form data in the background

The following process allows you to POST XML data to the page:

<property as="xs:string" name="*.*">

NOTE: Make sure you use validate("error") instead of require-valid, as the latter always returns a success value.

Example: using curl

The following examples use the curl command-line utility. They are indented on multiple lines for clarity but in practice each command must be written on a single line.


This runs the acme/order form in new mode in the background, and runs the configured processes if any.

Here is an example XML response:

<?xml version="1.0" encoding="UTF-8"?>


  • The caller must either call the service internally or have authorized the service.

  • Appropriate container or permission headers must also be set to allow accessing the form definition and data.

See also