Advertising spend import
Pull yesterday’s Meta and Google Ads costs into organization-owned client expenses.
Deterministic provider + account + date key prevents duplicate imports.
Tenant-aware CRM workflows and scheduled operations — from recurring agency work to secure, observable production jobs.

01 — Operational problem
Agency operations repeat at different cadences and with different risk profiles. The automation layer separates each workflow by business purpose while applying one consistent security and execution model.
Design principle
One global “run everything” script would be difficult to reason about and unsafe in a multi-tenant product. Each operation therefore owns its cadence, eligibility rules, safeguards, and outputs.
Responsibilities demonstrated
02 — Production workflow inventory
Each job has a narrow operational purpose, a fixed production schedule, and workflow-specific reliability controls.
Pull yesterday’s Meta and Google Ads costs into organization-owned client expenses.
Deterministic provider + account + date key prevents duplicate imports.
Generate the next invoice period while preserving currency, tenant ownership, and billing data.
Calendar arithmetic avoids fixed-day drift and handles month-end dates.
Aggregate overdue tasks, new leads, missed calls, outstanding invoices, and top client alerts.
The organization toggle, language, records, and recipients are resolved per tenant.
Build prior-month delivery metrics for active clients and send a localized summary.
Results are logged as success, skipped, or failed inside the correct organization.
Notify clients about pending invoices that are due within three days or already overdue.
A three-day per-invoice throttle prevents repeated daily messages.
Resolve scheduled workdays, approved time off, non-working days, and missing check-ins.
A database function applies one consistent rule set to the organization’s attendance data.
03 — Architecture
Every endpoint authenticates the scheduler, resolves organization scope, applies eligibility rules, executes its action, and returns or persists evidence.

04 — Reliability decisions
Scheduled service credentials can bypass normal user policies. Reliability therefore depends on explicit scope, retry behavior, timing rules, and visible failure modes.
Background service credentials bypass normal row policies, so organization_id is always selected, filtered, or written explicitly.
Advertising records use deterministic external references so a retried schedule skips data that already exists.
Payment reminders store their latest send time and wait three days before contacting the same invoice again.
Recurring periods use real month and year arithmetic rather than fixed 30-, 91-, or 365-day offsets.
Every scheduled endpoint refuses execution when CRON_SECRET or required service configuration is missing or invalid.
Workflow outputs persist into CRM activity, notifications, expenses, invoices, attendance, or automation run records.
05 — Control surface
The automation workspace shows inventory, active state, trigger → action models, run counts, recent activity, and error visibility.

Live organization controls
The daily team digest and monthly client report toggles genuinely enable or disable sending for the current organization.
Preset workflow concepts
Four earlier trigger → action presets remain visible as workflow models. They are not presented as production-executing custom rules; the interface states that the general rule engine is not yet launched.
06 — Localization and delivery
The same global schedule resolves each organization’s language, recipients, data, and enabled-state before producing output.
Organization-scoped notifications link recipients back to the relevant CRM view.
Team digests, client reports, and reminders use the organization’s RU/RO/EN language.
Connected directors can receive the daily digest and prioritized client alerts.
07 — Outcome
The outcome is documented through implemented schedules, state transitions, persistence behavior, and production code — not unsupported hours-saved or revenue claims.