Initial scaffold: Elsa 3.5 custom API server with sample Shout activity
- src/Elsa.CustomServer: minimal ASP.NET Core 8 host referencing Elsa 3.5 NuGets - Activities auto-registered via AddActivitiesFrom<Program>() — drop new files under Activities/ - Sqlite persistence for workflow definitions + runtime - Multi-stage Dockerfile targeting linux/amd64, ASP.NET 8 runtime, port 8080 - Forwarded-headers configured so URLs come out https:// behind Traefik - CORS wide-open so the standalone Studio (different origin) can talk to us
This commit is contained in:
41
README.md
Normal file
41
README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Elsa Custom Server
|
||||
|
||||
Custom Elsa Workflows API server. Extends stock Elsa 3.x with our own activities.
|
||||
|
||||
## Where activities live
|
||||
|
||||
`src/Elsa.CustomServer/Activities/*.cs` — anything marked `[Activity(...)]` under this
|
||||
folder is auto-registered via `AddActivitiesFrom<Program>()` in `Program.cs`.
|
||||
|
||||
To add a new node type in the Studio designer:
|
||||
|
||||
1. Drop a new file under `Activities/`.
|
||||
2. Inherit from `CodeActivity`, `CodeActivity<T>`, or `Activity` for triggerable ones.
|
||||
3. Rebuild and redeploy — Studio picks it up automatically the next time it fetches
|
||||
the activity descriptors.
|
||||
|
||||
Example — see `Activities/Shout.cs`.
|
||||
|
||||
## Local run
|
||||
|
||||
```sh
|
||||
dotnet run --project src/Elsa.CustomServer
|
||||
```
|
||||
|
||||
Listens on http://localhost:8080; API root is `/elsa/api`.
|
||||
|
||||
## Docker
|
||||
|
||||
```sh
|
||||
docker build -t elsa-custom-server .
|
||||
docker run --rm -p 8080:8080 \
|
||||
-e Identity__Tokens__SigningKey="$(openssl rand -base64 64)" \
|
||||
elsa-custom-server
|
||||
```
|
||||
|
||||
## Deployment
|
||||
|
||||
Coolify builds this image from the Dockerfile at repo root when the app is created
|
||||
with `build_pack: "dockerfile"`. The Studio (separate container running the stock
|
||||
`elsaworkflows/elsa-studio-v3` image) needs its `BACKEND__URL` env var pointed at
|
||||
this server's `/elsa/api`.
|
||||
Reference in New Issue
Block a user