Actions Tools App
actionstools-app is the backend for the CRM UI components used by the internal admin (IA) and service desk: notes, file attachments, tasks, comments, notifications, the supplier activity stream and the global settings (task statuses, email templates, folders). The UI components own the presentation; this service owns storage, permissions, notifications and the counters behind the task grid.
The 30-second model
-
Two Lambda functions, one code base.
ApiFunctionserves HTTP through API Gateway;WorkerFunctionruns background work. Both are defined intemplate.yamland deployed by AWS SAM as one CloudFormation stack per environment (actionstools-prod,actionstools-stage). -
Flask + flask-restx.
run.pybuilds the Flask app,lambda_handlers.pyadapts it to Lambda with apig-wsgi. Most endpoints are flask-restx namespaces (they show up in Swagger); a few are plain Flask blueprints. -
DynamoDB for everything. Eight
em_actions_*tables, accessed through flask-dynamo and the CRUD services of the internalpyb_flask_utilslibrary. -
Background work is a Lambda invoke. Functions decorated with
@async_taskare sent to the Worker as an asynchronous invocation. The Worker also consumes the tasks table stream (to keep grid counters current) and a 4-day cleanup schedule. -
Secrets live in Secrets Manager.
secrets_loader.pycopies theactionstools/<env>secret intoos.environat cold start, before any module reads configuration.
CRM UI ──X-Session-Token──► API Gateway (REST, CORS) ──► ApiFunction (Flask)
│ DynamoDB em_actions_*
│ Payability internal API (permissions, users)
│ Event logger / Messaging / B2B documents
│
lambda:Invoke (Event)
▼
em_actions_tasks stream ─────────────────────────► WorkerFunction
EventBridge rate(4 days) ────────────────────────► │ Slack DMs, notification emails, event log entries
│ task counters (em_actions_tasks_counters)
Where to read next
| If you want… | Read |
|---|---|
The big picture: functions, resources, layers |
|
How one request flows end to end |
|
Every endpoint, its headers and payloads |
|
What runs in the background and why |
|
Table names, keys and indexes |
|
The services this one calls |
Event logger and the other Integrations pages |
Running it locally, configuring it, shipping it |
|
Moving production off Zappa |
|
A term you do not recognise |
Repository layout
| Path | Contents |
|---|---|
|
Lambda entry points: |
|
Builds the Flask app ( |
|
Flask config object; reads every setting from |
|
Loads the Secrets Manager secret into |
|
Application package, one sub-package per resource — see Source map. |
|
unittest suite, offline (moto for DynamoDB). |
|
SAM template and per-environment deploy config. |
|
uv project and developer commands. |
|
GitHub Actions: tests on pull requests, deploys from |
|
One-off maintenance scripts and API usage examples. |
|
This Antora documentation component. |