Skip to main content
In this section, we’ll go through the folder structure of a typical process configuration project and explain each folder and file’s purpose.

Accounts

The src/accounts/ folder is where the process’s organization, its teams and its users are declared.
By convention, each type of account is declared in a separate file, and all are exported in the index.ts. To be generated, the accounts must be used in the workflow’s definition.
The files/ folder is used to store the account’s avatar images.

Environment variables

The process’ environment variables are declared in the .env file and in the .env.<envName> files depending on the generation environment.
The src/env/index.ts file is used to parse with a Zod schema and export the environment variables.
Additionnally, the environment variables are added to the workflow’s definition so that they can be used inside the actions’ effects.

Workflows

The process’ workflows are defined in subfolders of the src/workflows/ folder, as well as a shared folder which is used to declare shared constants, types and functions.
All worklows are exported in the index.ts file.

Workflow structure

Each workflow should follow the following structure:
Actions are defined in separate files and all are exported in the index.ts file.
The definitions folder is where the static data and functions are declared, see Definitions for more information.
data/repositories.ts
The workflow’s data are declared in this file, they then can be used in the actions’ effects.
functions/index.ts
The workflow’s functions are declared in this file, they then can be used in the actions’ effects.
state.types.ts
This file is used to declare the type of the workflow’s state data.
business.types.ts
This file is used to declare types unrelated to the configuration itself of the workflow. For example a status enum, a list of business programs, etc.
dsl.types.ts
This file is where the workflow’s dsl context is instantiated.
paths.types.ts
This file is where the types which will be used to validate the paths used in the UI widgets are declared.

Shared folder

The shared/ follows the same structure as the workflows/ folder, but is used to declare shared constants, state and functions which will be automagically added to all workflows.
restaurantProcess/
├── .env
├── .env.<envName>
├── tests/
├── dumps/
└── src/
    ├── account/
    │   ├── index.ts
    │   ├── files/
    │   ├── teams.ts
    │   └── org.ts
    ├── env/
    └── workflows/
        ├── index.ts
        ├── managerWorkflow/
        ├── restaurantWorkflow/
        │   ├── index.ts
        │   ├── actions/
        │   │   ├── index.ts
        │   │   ├── cancelOrder.ts
        │   │   ├── createOrder.ts
        │   │   └── comment.ts
        │   ├── definitions/
        │   │   ├── index.ts
        │   │   ├── data/
        │   │   │   └── repositories.ts
        │   │   └── functions/
        │   │       ├── mySuperFunction.ts
        │   │       └── index.ts
        │   ├── types/
        │   │   ├── business.types.ts
        │   │   ├── dsl.types.ts
        │   │   ├── paths.types.ts
        │   │   └── state.types.ts
        │   ├── ui/
        │   │   ├── overview/
        │   │   │   ├── overview.filters.ts
        │   │   │   └── overview.ts
        │   │   └── infos.ts
        │   ├── constants.ts
        │   └── migration.ts
        ├── shared/
        │   ├── definitions/
        │   ├── constants.shared.ts
        │   ├── state.shared.ts
        │   ├── types.shared.ts
        │   └── utils.type.shared.ts
        ├── constants.global.ts
        ├── repository.ts
        ├── script.ts
        └── types.ts