Improve docstring

This commit is contained in:
shamoon
2025-12-08 14:35:14 -08:00
parent dd8a421b83
commit 5a9c3f375e

View File

@@ -679,12 +679,14 @@ def run_workflows(
original_file: Path | None = None, original_file: Path | None = None,
) -> tuple[DocumentMetadataOverrides, str] | None: ) -> tuple[DocumentMetadataOverrides, str] | None:
""" """
Run workflows which match a Document (or ConsumableDocument) for a specific trigger type or a single workflow if given. Execute workflows matching a document for the given trigger. When `overrides` is provided
(consumption flow), actions mutate that object and the function returns `(overrides, messages)`.
Otherwise actions mutate the actual document and return nothing.
Assignment or removal actions are either applied directly to the document or an overrides object. If an overrides Attachments for email/webhook actions use `original_file` when given, otherwise fall back to
object is provided, the function returns the object with the applied changes or None if no actions were applied and a string `document.source_path` (Document) or `document.original_file` (ConsumableDocument).
of messages for each action. If no overrides object is provided, the changes are applied directly to the document and the
function returns None. Passing `workflow_to_run` skips the workflow query (currently only used by scheduled runs).
""" """
use_overrides = overrides is not None use_overrides = overrides is not None