1---2name: p4-stream-workflows3description: Stream Workflows4---56# Stream Workflows78Use the `query_streams` and `modify_streams` tools to manage P4 streams.910## Querying Streams1112| Action | Purpose | Key Parameters |13|--------|---------|----------------|14| `list` | List streams under a depot path | `stream_path`, `filter`, `fields`, `max_results` |15| `get` | Get a single stream spec | `stream_name` |16| `children` | List child streams | `stream_name` |17| `parent` | Get parent stream | `stream_name` |18| `graph` | Get full stream hierarchy | `stream_path` |19| `integration_status` | Check pending integrations between stream and parent | `stream_name`, `both_directions`, `force_refresh` |20| `get_workspace` | Get workspace bound to a stream | `stream_name`, `workspace` |21| `list_workspaces` | List all workspaces for a stream | `stream_name`, `user` |22| `validate_file` | Check if a file path is valid in a stream | `stream_name`, `file_paths`, `workspace` |23| `validate_submit` | Verify a changelist is ready to submit in stream context | `workspace`, `changelist` |24| `check_resolve` | Check if resolve is needed after integration | `stream_name` |25| `interchanges` | List changes not yet integrated between stream and parent | `stream_name`, `reverse`, `limit` |2627## Modifying Streams2829| Action | Purpose | Key Parameters |30|--------|---------|----------------|31| `create` | Create a new stream | `stream_name`, `stream_type`, `parent`, `description` |32| `update` | Update stream spec fields | `stream_name`, updated fields |33| `delete` | Delete a stream (requires approval) | `stream_name` |34| `edit_spec` | Open stream spec for editing | `stream_name`, `changelist` |35| `resolve_spec` | Resolve spec conflicts | `stream_name`, `resolve_mode` |36| `revert_spec` | Revert spec changes | `stream_name` |37| `shelve_spec` | Shelve stream spec changes | `stream_name`, `changelist` |38| `unshelve_spec` | Unshelve stream spec changes | `stream_name`, `target_changelist` |3940## Stream Propagation (Branching & Merging)4142| Action | Purpose | Key Parameters |43|--------|---------|----------------|44| `copy` | Copy changes between parent/child streams | `stream_name`, `changelist`, `parent_stream` |45| `merge` | Merge changes between parent/child streams | `stream_name`, `changelist`, `parent_stream` |46| `integrate` | Integrate with custom source/target (advanced) | `stream_name`, `changelist`, `parent_stream` |47| `populate` | Seed a new stream with files from parent | `stream_name` |48| `switch` | Switch a workspace to a different stream | `stream_name`, `workspace` |49| `create_workspace` | Create a workspace bound to a stream | `stream_name`, `workspace_name`, `root` |5051## Common Workflows5253### Create a feature branch54551. `modify_streams` → `create` a new development stream with parent = mainline562. `modify_streams` → `populate` to seed the new stream with parent files573. `modify_streams` → `create_workspace` bound to the new stream5859### Propagate changes to main60611. `query_streams` → `interchanges` to see what hasn't been merged yet622. `query_streams` → `integration_status` to check current state633. `modify_streams` → `copy` from child to parent (copies up)644. `query_streams` → `check_resolve` to see if resolves are needed655. `modify_streams` → `resolve_spec` if needed6667### Merge from parent to child68691. `query_streams` → `interchanges` to see pending changes702. `modify_streams` → `merge` from parent to child (merges down)713. Resolve any conflicts7273### Switch workspace streams74751. `query_streams` → `list_workspaces` to find existing workspaces762. `modify_streams` → `switch` the workspace to the target stream7778## Best Practices7980- Always check `interchanges` before merging or copying to understand what will be propagated.81- Use `copy` for upward propagation (child → parent) and `merge` for downward (parent → child).82- Use `validate_submit` before submitting to catch stream-related issues early.83- Use `check_resolve` after integration to ensure all conflicts are handled.84- `populate` should only be used once when seeding a newly created stream.