# Enquiry-to-CRM workflow blueprint
Thirtha Raj Nayek | Original demonstration specification

## Goal
A valid enquiry becomes an owned record with a follow-up task and an inspectable run.

## Input contract
contact_name: required, trimmed, maximum 80 characters
email: required, valid format, normalised for this demo
interest: cloud | automation | partnership
brief: required, trimmed, maximum 700 characters

## Routing
cloud -> Cloud & identity advisor -> Scope tenant and workload dependencies
automation -> Automation lead -> Map workflow and integration boundaries
partnership -> Partnership coordinator -> Review institution, scope and next meeting

## Processing
1. Validate input before creating a record.
2. Use normalised email to find an existing demonstration contact.
3. Create or update the record and assign the selected owner.
4. Create a follow-up task using record ID + task purpose + interest as the key.
5. Preserve the record if task creation fails; expose the incomplete state.
6. Retry the failed step without creating the same task twice.
7. Prepare an acknowledgement preview. The demonstration never sends email.
8. Export the record, tasks and event history for review.

## Production adaptation
Use authenticated server-side integrations and durable records. Enforce unique
keys atomically; a browser Map is not concurrency control. Use authenticated
webhooks, a durable queue, bounded retries/backoff and a dead-letter/manual path.
Define retention, permissions, consent fields where needed, and audit ownership.
The browser demo is intentionally session-only and has no external integrations.

## Tradeoff
Preserving a partial success supports recovery but requires monitoring incomplete
runs. Do not silently mark the overall workflow successful after a failed task.
