A node that waits for all specified predecessors to trigger it before outputting.
| 45 | |
| 46 | |
| 47 | class JoinNode(BaseNode): |
| 48 | """A node that waits for all specified predecessors to trigger it before |
| 49 | outputting.""" |
| 50 | |
| 51 | @property |
| 52 | @override |
| 53 | def _requires_all_predecessors(self) -> bool: |
| 54 | return True |
| 55 | |
| 56 | @override |
| 57 | def _validate_input_data(self, data: Any) -> Any: |
| 58 | """Validates individual trigger inputs against input_schema.""" |
| 59 | if self.input_schema and isinstance(data, dict): |
| 60 | return { |
| 61 | k: self._validate_schema(v, self.input_schema) |
| 62 | for k, v in data.items() |
| 63 | } |
| 64 | return super()._validate_input_data(data) |
| 65 | |
| 66 | @override |
| 67 | async def _run_impl( |
| 68 | self, |
| 69 | *, |
| 70 | ctx: Context, |
| 71 | node_input: Any, |
| 72 | ) -> AsyncGenerator[Any, None]: |
| 73 | """JoinNode simply passes through the aggregated inputs provided by the orchestrator.""" |
| 74 | yield Event( |
| 75 | output=node_input, |
| 76 | branch=ctx._invocation_context.branch, |
| 77 | ) |
no outgoing calls