Examples
Hosted workflow
Django Postgres plus Synapsor
Keep Django ORM for the web app and use Synapsor for agent-safe read/write workflows.
Problem
Django apps often have mature models and permissions, but agent workflows still need evidence, approval, and replay.
Why app glue gets messy
Duplicating those controls in prompts and view code is fragile.
How Synapsor helps
Synapsor adds reviewed workflows around selected Django/Postgres tables or views.
Value sources
Example names and seed ids are developer-defined. SESSION values are set by your backend. ARG values come from the SDK/HTTP call. Handles such as wrp://..., evidence://..., and agent-run://... are returned by Synapsor and should be stored for audit/replay.
Read the value-source guide Expected outcome
Django remains the normal app layer while agents use Synapsor capabilities.
Production checks
- Use a read-only source user separate from Django's writer credentials.
- Prefer safe views for sensitive models.
- Use a Django/Celery worker for approved writeback.
- Keep model input out of trusted HIDDEN bindings.
schema.sql
class Ticket(models.Model):
tenant_id = models.TextField()
customer_id = models.TextField()
status = models.TextField()
resolution_note = models.TextField(null=True)agent.ddl.sql
CREATE AGENT WORKFLOW support.django_ticket_flow
SESSION REQUIRE tenant_id, principal, current_ticket_id
ALLOWED CAPABILITIES (support.answer_ticket_question, support.propose_ticket_resolution)
EVIDENCE REQUIRED
AUTO BRANCH ON PROPOSAL
CHECKPOINT EVERY STEP;python
ticket = Ticket.objects.get(id=ticket_id, tenant_id=request.user.tenant_id)
synapsor.set_session({"tenant_id": request.user.tenant_id, "principal": request.user.id, "current_ticket_id": ticket.id})
result = synapsor.capabilities.invoke("support.answer_ticket_question", {"question": request.POST["question"]})