> For the complete documentation index, see [llms.txt](https://docs.autommate.com/userguide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autommate.com/userguide/mcp-and-ai-reference/use-cases-and-examples/reusable-tenant-service.md).

# Recipe: design a reusable service for several tenants

Create one service design and apply it to several customer environments with separate connections, configuration and operational ownership. Reuse the service behavior while keeping each customer's execution context explicit.

This recipe uses employee onboarding as an example. It is a deployment design and acceptance plan, not proof that your environment supports every step through MCP. Confirm the installed Service Automation features and advertised tools before implementing it.

## Separate the reusable design from tenant configuration

| Reusable service definition               | Configuration for each tenant                                          |
| ----------------------------------------- | ---------------------------------------------------------------------- |
| Required onboarding inputs and validation | Tenant and deployment identity.                                        |
| Action sequence and allowed outcomes      | Directory, service-management and other application connections.       |
| Approval points and exception paths       | Approval owner and customer-specific policy.                           |
| Retry and duplicate-control design        | Group, department and catalog mappings.                                |
| Output contract and verification steps    | Operational owner, notification destination and agreed service target. |

Keep customer values and credentials out of the shared example. A reusable service can have different approved bindings for different customers; copying a flow without reviewing those bindings is not a completed deployment.

## Example service

An authorized requester supplies a new employee's start date, department and manager. The service validates the request, obtains any required approval, provisions the agreed access, verifies the result and returns a completion or exception report.

In the documented **Dublin 6.0.0** baseline, Foundation **Approval Policies, Access Policies, and Time & SLA are marked Coming soon**. This example does not assume those controls are available. Where approval is required, use an approval process already supported by your workflow or system of record, verify the decision before execution, and document that dependency. Check the [product version scope](https://docs.autommate.com/userguide/start-here/documentation-scope-and-product-versions) for the installed release.

Use a small initial scope, such as creating an onboarding request and preparing an approved account setup. Add further actions after the first version works reliably. Choose account-provisioning and approval behavior according to the customer's policy and the integrations available in that tenant.

```mermaid
flowchart TB
    D[Reviewed service definition] --> A[Tenant A deployment]
    D --> B[Tenant B deployment]
    A --> AC[Tenant A connections and policy]
    B --> BC[Tenant B connections and policy]
    AC --> AR[Tenant A request and verified result]
    BC --> BR[Tenant B request and verified result]
```

## Implementation sequence

1. **Define the service contract.** Agree required inputs, successful outcomes, approval boundaries and what an exception report contains.
2. **Inspect available components.** Find the integrations, actions and reusable work needed for that contract. Confirm input types and output mappings from the actual environment.
3. **Prepare and release the design.** Build and review Work Item drafts, then use their published version IDs in the Service plan. Preview the Service operation. `services_create` apply publishes the initial blueprint version in the reviewed contract; tenant deployment drafts and activation are separate steps. Keep identifiers and dependencies consistent with the installed version.
4. **Prepare the first tenant.** Select the target tenant and configure its connections and mappings through the supported binding process. Review the intended actions before activating the deployment.
5. **Test one tenant.** Submit a controlled request, inspect the execution and verify the external result. Correct errors before making the service available for regular use.
6. **Prepare the next tenant separately.** Reuse the reviewed definition, then supply and verify that tenant's bindings. Do not carry over another customer's connection references.
7. **Operate and improve.** Monitor each deployment and retain its definition version, configuration and test evidence. Review a revised definition before updating further deployments.

Do not assume that an update to a shared definition automatically updates every deployment. Use the release and deployment controls available in your version, read back the active version in each target and verify the result.

## Two distinct AI tasks

**The authoring assistant** helps an authorized operator discover components, create or edit the definition, test it and prepare a deployment. These operations require matching tools and permissions. The current capability guide lists the advertised Service and deployment operations. Verify them on the active connection before use.

**The consuming assistant** helps an authorized requester use an already approved service. It collects the allowed inputs and invokes the appropriate execution path for the selected tenant. It should not redesign the service, replace credentials or deploy changes as part of fulfilling an ordinary request.

MCP access and external application access are separate. Verify both the user's access to the tenant and the application connections used by the deployment. Confirm tenant isolation with tests rather than inferring it from a successful login.

## Ask your assistant

> Help me design a reusable employee-onboarding service. First inspect the capabilities available in this environment. Separate the reusable definition from each tenant's connections, policy and mappings. Start with one tenant and a controlled test request. Show the outcome evidence and unresolved gaps before preparing the second tenant. Do not assume service-authoring, cross-tenant deployment or bulk-update tools exist; use only the capabilities actually exposed by this connection.

## Acceptance checks

| Test                                           | Expected result                                                                                                                                       |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| Tenant A submits a valid request               | Only Tenant A's configured systems are affected; the result is verified.                                                                              |
| Tenant B submits the same kind of request      | Tenant B's own connections and mappings are used.                                                                                                     |
| An unauthorized user requests access           | The request is refused by the relevant access controls and no business action is executed.                                                            |
| A binding is missing or invalid                | A specific configuration failure; no fallback to another tenant's connection.                                                                         |
| Approval is required                           | The supported workflow or system-of-record approval is checked before execution; the test does not assume Foundation Approval Policies are available. |
| An external action fails                       | The agreed exception path runs and the owner can identify what completed and what remains.                                                            |
| The same request is submitted again            | The defined duplicate-control behavior is observed and recorded.                                                                                      |
| A revised definition is deployed to one tenant | The active version and outcome are verified there before rollout continues.                                                                           |
| One tenant has a failure                       | Its result remains distinct from other tenants' service results.                                                                                      |

Keep a deployment record for each tenant: definition version, binding references, owner, test request, observed result and outstanding action. A template is reusable when those differences are controlled and the same acceptance checks can be repeated.

## Related guides

* [Documentation scope and product versions](https://docs.autommate.com/userguide/start-here/documentation-scope-and-product-versions)
* [Select your workspace and authorize access](https://docs.autommate.com/userguide/mcp-and-ai-reference/connect-an-ai-client-with-mcp/authorize-mcp-access)
* [Read Hyperflow and action input contracts](https://docs.autommate.com/userguide/mcp-and-ai-reference/read-hyperflow-and-action-input-contracts)
* [Track run status and verify results](https://docs.autommate.com/userguide/mcp-and-ai-reference/track-run-status-and-verify-results)

## Build a service from verified context

* [Build a service with an AI assistant](https://docs.autommate.com/userguide/mcp-and-ai-reference/structured-service-authoring) — outcome, native components, Govern/Execute/Prove and a controlled lifecycle.
* [Resolve deployment inputs](https://docs.autommate.com/userguide/mcp-and-ai-reference/deployment-input-resolution) — reuse valid context, Engage payloads and earlier Work Item outputs; ask only for unresolved decisions.
* [Discover native apps, triggers and Data Manager](https://docs.autommate.com/userguide/mcp-and-ai-reference/native-app-trigger-and-data-discovery) — find the installed component and its exact contract before building a custom alternative.
