## ProcessTemplateBuilder


Builder for process templates, resource slots, and step templates.


Usage

``` python
ProcessTemplateBuilder(
    name,
    version,
    *,
    backend,
    namespace_context,
    command_context,
    process_template_id=None,
    on_existing="warn"
)
```


Context-manager exit commits clean work and rolls back exceptions. Existing templates load by UUID; `on_existing` controls identity reuse, while draft validation reports invalid slots, steps, or parameters before submission.


## Methods

| Name | Description |
|----|----|
| [add_resource_slot()](#add_resource_slot) | Add typed input/output resource slot after validating direction. |
| [add_step()](#add_step) | Open builder for a named process step. |
| [get_model()](#get_model) | Return a pydantic model for the process template, optionally reloading |
| [set_model()](#set_model) | Replace working template after verifying UUID identity. |

------------------------------------------------------------------------


#### add_resource_slot()


Add typed input/output resource slot after validating direction.


Usage

``` python
add_resource_slot(
    name, resource_type, direction, create_resource_type=False, required=True
)
```


------------------------------------------------------------------------


#### add_step()


Open builder for a named process step.


Usage

``` python
add_step(name)
```


------------------------------------------------------------------------


#### get_model()


Return a pydantic model for the process template, optionally reloading


Usage

``` python
get_model(*, update=False)
```


from the backend first. Critical fields are locked against mutation.


------------------------------------------------------------------------


#### set_model()


Replace working template after verifying UUID identity.


Usage

``` python
set_model(model)
```
