Skip to main content
Version: Next

Service, Remote Action, Service App

There are two types of applications in DRAW:

  • UI App: UI Apps are frontend applications with a user interface. These run on a device which has a screen (smartphone, tablet, laptop). UI Apps run in web browsers or can be wrapped in e.g. Electron.

  • Service App: Service Apps are backend applications which don't have a user interface. These run on top of node.js, and can therefore be deployed on vast variety of devices, from Olympe Cloud to your own AWS, Azure or GCP instances, local computers and IoT devices.

Service Apps, Services and Remote Actions

Service Apps are created from the Project’s Editor Marketplace.

Service apps can run two types of services: Services, and Remote Actions.

service_apps

Services

Services are long running tasks. They are started when the Service App is launched, and run until the Service App is stopped. Services are typically used to:

  • Listen to incoming emails
  • Run batch jobs
  • Expose REST APIs
  • Synchronize cloud applications
  • Send notifications when something happens in another system
  • Run scheduled tasks
  • ...

A Service has no input, and its configuration is therefore generally read from configuration files, APIs or other external sources.

Remote Actions

Remote Actions are triggered when called and completes after outputting all results. They are typically called by UI Apps (or by other Service Apps) to trigger an action that must run on a backend for security or performance reasons. Remote Actions can typically be used to:

  • Send emails or notifications
  • Call REST APIs using secure API keys, certificates or other authentication mechanisms
  • Access databases, file shares, blob storage or other restricted services
  • ...

Behavior of Remote Actions

Within DRAW, remote actions are used like any other action. During execution however, the inputs of the remote action are serialized, sent to the Service App running that remote action, which executes the content of the remote action, and outputs are serialized back to the caller.

Remote actions are synchronous, and can therefore be subject to timeouts if running for too long (the timeout is configurable).

Remote actions can be nevertheless be used to implement asynchronous patterns. For example, one could have one remote action which starts a process and returns a handle, and another remote action which uses that handle and checks whether the process is completed or not.

Examples

The "Running Back-end" tutorial shows how those the core concepts.

Running Several Service App

A single Service App can host multiple services and remote actions. It is also possible for a single service or remote action to be used within multiple service apps. For example:

  • Service App 1 runs the Send Email, Create Ticket in ServiceNow and Create RFQ in SAP Ariba remote actions
  • Service App 2 runs Send Email and Create Ticket in ServiceNow

Such configurations are typically useful for

  • A developer creates a single Service App running the services and remote actions she is working on, and runs that service app locally on her laptop.
  • For simplicty, the dev environment has one service app running all services. In preprod and production however, one may have one service app which is deployed on premise to be close to data sources, while another service app runs standard services, e.g. to send emails.
  • If multiple projects are being developed on the same dev environment, services could be mutualized into a single service app. When the projects are deployed to dedicated environments in prod for instance, they may need one service app per project.

The Service App can be run from the editor by clicking on the Play button, or by selecting Run in browser from the context menu in the folder editor. This is mostly useful to understand the concepts without leaving DRAW. Once going into integration scenarios, it is necessary to actually run the Service App within a node.js process to have full flexibility. Steps to do so can be found in the [local install guide](local_install#Run a backend).