# Service definition

A service is a component of your application that can be used for different processes and can also be shared with other projects.

Services are code that can receive tasks from a process.

The types of services that can be created is totally up to each developer. It’s the responsibility of the developer to decide which tasks should go to which service

Services run in Docker to provide a sandbox and a normalized environment to remove any side effects that may occur when running on many different machines. See more information on the Docker website.

Stateless service

Services should be stateless, meaning that they shouldn't store any data on disk. Services should be able to restart or be replicated without losing any information or side effect. More information

# Service structure

In order to make a source code compatible with Liteflow you need to add a liteflow.yml file at the root of your service.

├── .liteflow.yml
├── .liteflowignore
└── ... service source code

A service can be written in many languages, but it is recommended to use Javascript as it is the easiest way to get started.


When you create a service you can use the command liteflow service:init to generate a default service in Javascript or Typescript