Skip to main content
Version: Next

Operations as Service Functions

A service function (service_function, in the menu Webhooks) connects an operation to an external HTTP service. When the operation runs, EP calls the service's endpoint and passes the entity along. The service can be written in any language and run anywhere EP can reach it.

Connect an External Function​

  1. Open Administration → Behaviors → Actions › Webhooks.

  2. Click and fill in:

    FieldExampleNotes
    nameprint_stampLetters, digits and _ only.
    endpointhttp://stamp-service:8080/print_stampFull URL of your service. EP must be able to reach it.
  3. Click Submit.

  4. Attach the service function to an entity type: open the entity type, tab Actions (button on the entity) or Hooks (automatic), click Link existing and select it. See Actions.

Example from the standard content: the entity type Address has the action Stamp, which calls the service function print_stamp.

What EP Sends​

As a Hook​

When a service function runs as a lifecycle hook, EP sends a JSON body with the entity and the event:

{
"entity": { "…": "the entity being created, updated or transitioned" },
"event": {
"name": "on_status_change",
"timing": "pre",
"kind": "status",
"from_status": 100,
"to_status": 200,
"from_status_name": "in_work",
"to_status_name": "released"
}
}
FieldPresent forMeaning
event.nameallon_create, on_update or on_status_change
event.timingallpre (before the operation, may veto) or post (after it, informational)
event.kindallWhat actually changed: create, update, merge, status, …
event.from_status / event.to_statuson_status_changeStatus numbers
event.from_status_name / event.to_status_nameon_status_changeStatus names

The call is synchronous with a 5 second timeout — a slow service slows down the save that triggered it.

Your response decides for a pre hook:

ResponseEffect
2xxThe operation goes ahead.
4xxVeto: the operation is rejected as a business decision.
5xx, timeout, not reachableThe operation is rejected as a technical failure.

A post hook cannot stop anything; errors are only logged.

As an Action​

When a user clicks the action button, the browser calls EP with POST …/@action/<name> (the same call a program can make, see REST API). EP itself then calls your endpoint:

MethodPOST
Content typeapplication/json
AuthenticationNone — no token of the user, no signature, no secret. Protect your service on the network level.
Timeout5 seconds
CallSynchronous: the user waits until your service answers.

The body contains the entity and the payload of the action call:

{
"entity": {
"id": "96577a66-…",
"root_id": "96577a66-…",
"@key": "ADDR0000001",
"@self": "address/ADDR0000001",
"@branch": "main",
"@label": "Julius-Hatry-Str. 1",
"metadata": { "created_by": "SYSTEM", "created_on": "2026-10-27T15:46:46+00:00", "…": "…" },
"properties": { "street": "Julius-Hatry-Str.", "number": "1", "zip": 68163, "city": "Mannheim", "…": "…" },
"relationships": { "…": ["<uuid of the relationship instance>"] },
"lists": {}, "components": {}, "traits": {}
},
"payload": {}
}
FieldContent
entityThe entity the action runs on, at depth 1: properties with their values (multi-language values with all languages), relationships as lists of ids, metadata, @branch, and @status if the type has a lifecycle.
payload{}, or {"pre_mask_fields": {…}} if the action has an input mask: the fields marked Include in action payload, without empty values.

The user who clicked and the language of the user interface are not sent. metadata.created_by is the author of the entity's commit, not the person who started the action.

Your Response​

EP passes the body of your response on as the result of the action — regardless of the HTTP status code and content type. JSON is passed on as JSON, everything else as text. The user then sees:

Your responseShown to the user
{"result": …, "infos": […], "warnings": […], "errors": [{"code": "…", "message": "…"}]}One message per entry: errors red, warnings yellow, infos white. With errors, the action counts as failed.
An HTML <table>…</table>, or {"html_table": "<table>…</table>"}Dialog Action Result with the table, and the message Action completed
A PDF, PNG or JPEG as base64, e.g. {"base64": "…", "mimeType": "image/png", "filename": "stamp.png"}Dialog Result with a preview
Any other text or JSONA message with the text (up to 200 characters)
No answer within 5 seconds, or not reachableThe message Empty result

After a successful action, the overview page reloads, so changes your service made through the REST API become visible.

Signal errors in the body

Because the status code is not evaluated, report errors with the errors list in the response body — a 4xx or 5xx status alone is shown as a normal result.

Example: the action Stamp on an address calls the webhook print_stamp. The service answers with a PNG image as base64; the user sees the stamp in the dialog Result.

Writing Back to EP​

A service function receives data, but does not change EP by itself. To change entities, your service calls the REST API — for example PUT on the entity. Each such write creates a commit and passes through the same checks as a save in the user interface (lifecycle status, required fields, hooks).

Running Your Own Business Logic With EP​

A future version of this documentation will describe how to package your own business logic as a container, so that it runs together with the EP platform — deployed, started and reachable alongside EP, without operating a separate server.