API Reference¶
Top-level Package¶
Top-level public API for PipeBridge.
This module intentionally exposes a hybrid public surface:
the high-level
PipeBridgefacade for most consumersthe core services for advanced composition scenarios
the main request/config objects required by upload, update, and move flows
- class pipebridge.PipeBridge(token, base_url, pipe_schema_cache_ttl_seconds=300, transport_config=None)[source]¶
Bases:
objectRoot public facade of the Pipefy SDK.
This class wires the HTTP client and all domain facades, exposing a cohesive and stable API surface for cards, phases, pipes, and files.
- Parameters:
token (str)
base_url (str)
pipe_schema_cache_ttl_seconds (int)
transport_config (Optional[TransportConfig])
- class pipebridge.PipefyHttpClient(auth_key, base_url, transport_config=None)[source]¶
Bases:
objectHandles HTTP communication with Pipefy GraphQL API.
This class is responsible for: - Sending HTTP requests to Pipefy - Handling transport-level errors - Validating response structure - Mapping API errors to domain exceptions
It does NOT: - Apply business rules - Transform domain data
- Parameters:
auth_key (str) – str = API authentication token
base_url (str) – str = Pipefy GraphQL endpoint
transport_config (TransportConfig | None)
- Raises:
ValidationError – When auth_key is invalid or empty
MissingBaseUrlError – When base_url is not provided
- Example:
>>> client = PipefyHttpClient(auth_key="valid_token", base_url="www.pipebridge.example.com.br") >>> isinstance(client, PipefyHttpClient) True
- sendRequest(query, variables=None, timeout=30)[source]¶
Sends a GraphQL request to Pipefy API.
Handles: - Payload construction - HTTP request execution - JSON parsing - Response validation - Error mapping
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – If query is invalid
TimeoutRequestError – If the request exceeds the configured timeout
ConnectionRequestError – If the client cannot establish or maintain a connection
RateLimitRequestError – If Pipefy rejects the request due to rate limiting
TransportAuthenticationError – If the request fails due to authentication issues
TransportInvalidTokenError – If the provided API token is invalid
TransportUnauthorizedError – If the authenticated principal lacks permission
RequestError – If a generic transport or API failure occurs
TransportUnexpectedResponseError – If the response format is invalid
- Example:
>>> client = PipefyHttpClient(auth_key="valid_token", base_url="www.pipebridge.example.com.br") >>> query = "{ me { id } }" >>> isinstance(query, str) True
- Return type:
- property transport_config: TransportConfig¶
Expose the effective transport configuration bound to this client.
- class pipebridge.TransportConfig(timeout=30, verify_ssl=True, ca_bundle_path=None, max_retries=0, retry_delay_seconds=0.0, retry_backoff_multiplier=1.0)[source]¶
Bases:
objectTransport-level configuration for HTTP communication with Pipefy.
Defaults preserve the current behavior while allowing TLS and timeout customization in a backward-compatible way.
- Parameters:
- class pipebridge.CardService(client, pipe_schema_cache_ttl_seconds=300)[source]¶
Bases:
objectService responsible for card operations in Pipefy.
This service provides a complete abstraction over Pipefy GraphQL for managing cards, including creation, retrieval, updates, and movement across phases.
- param client:
PipefyHttpClient = HTTP client instance
- example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> isinstance(service, CardService) True
- Parameters:
client (PipefyHttpClient)
pipe_schema_cache_ttl_seconds (int)
- invalidatePipeSchemaCache(pipe_id=None)[source]¶
Invalidate the in-memory pipe schema cache.
- Parameters:
pipe_id (str | None) – str | None = Specific pipe identifier. When omitted, the entire schema cache is invalidated.
- Returns:
None
- Return type:
None
- getPipeSchemaCacheEntryInfo(pipe_id)[source]¶
Retrieve metadata about a specific cached pipe schema entry.
- createCard(pipe_id, title, fields=None)[source]¶
Create a new card in a pipe.
This method creates a card in the specified pipe and optionally sets initial field values.
- Parameters:
- Returns:
dict = Raw API response containing created card metadata
- Raises:
ValidationError – When pipe_id or title is empty
ValidationError – When fields is not a dictionary
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.createCard) True
- Return type:
- createCardSafely(pipe_id, title, fields=None)[source]¶
Create a new card after validating input against the pipe start form schema.
- Parameters:
- Returns:
dict = Raw API response containing created card metadata
- Raises:
ValidationError – When the pipe, title, or field payload is invalid
RequiredFieldError – When a required start form field is missing or empty
InvalidFieldOptionError – When a start form option value is invalid
RequestError – When request execution fails
- Return type:
- getRawCard(card_id, query_body)[source]¶
Execute a raw GraphQL query for a card.
This method allows full control over the GraphQL query structure.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When card_id or query_body is empty
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.getRawCard) True
- Return type:
- getCardStructured(card_id, query_body=None)[source]¶
Retrieve structured card data.
This method abstracts GraphQL complexity by providing a default query that includes commonly used fields such as phases, fields, labels, assignees, and attachments.
- Parameters:
- Returns:
dict = Structured card data
- Raises:
ValidationError – When card_id is empty
RequestError – When request execution fails
UnexpectedResponseError – When API response is invalid or missing expected data
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.getCardStructured) True
- Return type:
- getCardPipeField(card_id, field_id)[source]¶
Retrieve schema metadata for a card field anywhere in the parent pipe.
This helper is schema-oriented. It does not depend on whether the field currently appears in
card.fields.
- getCardCurrentPhaseField(card_id, field_id)[source]¶
Retrieve schema metadata for a field in the card current phase.
This helper is schema-oriented. It does not depend on whether the field currently appears in
card.fields.
- listCardAttachments(card_id)[source]¶
Retrieve all attachments exposed by the Pipefy card attachments surface.
This helper is more robust than reading attachment URLs from
card.fieldsbecause it also works for attachment fields that are not materialized in the current card field payload.
- listCardAttachmentsByField(card_id, field_id)[source]¶
Retrieve attachments associated with a specific field in a card.
- moveCardToPhase(card_id, phase_id)[source]¶
Move a card to another phase in Pipefy.
This method executes a GraphQL mutation to move a card from its current phase to a destination phase.
- Parameters:
- Returns:
dict = Raw API response containing updated card reference
- Raises:
ValidationError – When card_id or phase_id is empty
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.moveCardToPhase) True
- Return type:
- moveCardToPhaseSafely(card_id, destination_phase_id, expected_current_phase_id=None, config=None, extra_rules=None)[source]¶
Move a card to another phase after validating transition readiness.
This safe flow can validate destination required fields before executing the low-level move mutation.
- Parameters:
card_id (str) – str = Card identifier
destination_phase_id (str) – str = Destination phase identifier
expected_current_phase_id (str | None) – str | None = Optional expected source phase identifier
config (CardMoveConfig | None) – CardMoveConfig | None = Optional flow configuration
extra_rules (List[BaseRule] | None) – list[BaseRule] | None = Optional additional rules
- Returns:
dict = Raw API move response
- Raises:
ValidationError – When transition validation fails
RequiredFieldError – When destination required fields are still pending
RequestError – When the low-level move request fails
- Return type:
- searchCards(pipe_id, title)[source]¶
Search for cards in a pipe by title.
This method executes a GraphQL query to find cards whose titles match the provided search term.
- Parameters:
- Returns:
list[dict] = List of card nodes containing basic information (id, title)
- Raises:
ValidationError – When pipe_id or title is empty
UnexpectedResponseError – When API response structure is invalid
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.searchCards) True
- Return type:
- relateCards(parent_id, child_id, source_id)[source]¶
Create a relationship between two cards in Pipefy.
This method executes a GraphQL mutation to establish a relationship between a parent card and a child card using a Pipe relation.
- Parameters:
- Returns:
dict = Raw API response containing the created relation ID
- Raises:
ValidationError – When parent_id, child_id or source_id is empty
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.relateCards) True
- Return type:
- listAllCards(pipe_id, attributes=None, filters=None, only_phase_name=None)[source]¶
Retrieve all cards from a pipe using cursor-based pagination.
This method iteratively fetches all cards from a given pipe using GraphQL pagination. It supports optional filtering and phase-based restriction.
- Parameters:
pipe_id (str) – str = Pipe ID from which cards will be retrieved
attributes (List[str] | None) – list[str] | None = List of attributes to include in the query. Defaults to [“id”, “title”]
filters (Dict[str, Any] | None) – dict | None = GraphQL filter object to refine results
only_phase_name (str | None) – str | None = If provided, only cards belonging to this phase name will be returned
- Returns:
list[dict] = List of card nodes matching the query criteria
- Raises:
ValidationError – When pipe_id is empty
ValidationError – When attributes is not a list
UnexpectedResponseError – When API response structure is invalid
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.listAllCards) True
- Return type:
- listCardsFromPhase(phase_id, limit=50)[source]¶
Retrieve all cards from a specific phase using cursor-based pagination.
This method iteratively fetches cards from a given phase, handling pagination internally until all cards are retrieved.
- Parameters:
- Returns:
list[dict] = List of card nodes containing basic information (id, title)
- Raises:
ValidationError – When phase_id is empty
ValidationError – When limit is not a positive integer
UnexpectedResponseError – When API response structure is invalid
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.listCardsFromPhase) True
- Return type:
- deleteCard(card_id)[source]¶
Delete a card from Pipefy.
This method executes a GraphQL mutation to permanently remove a card identified by its ID.
- Parameters:
card_id (str) – str = Unique identifier of the card to be deleted
- Returns:
dict = Raw API response indicating operation success
- Raises:
ValidationError – When card_id is empty
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.deleteCard) True
- Return type:
- updateField(card_id, field_id, value, config=None, extra_rules=None, extra_handlers=None)[source]¶
Update a single field of a card.
This is a convenience wrapper over updateFields.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When card_id or field_id is empty
RequestError – When request execution fails (propagated from updateFields)
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.updateField) True
- Return type:
- updateFields(card_id, fields, expected_phase_id=None, config=None, extra_rules=None, extra_handlers=None)[source]¶
Updates multiple fields of a card using Pipefy API.
- This method performs:
Phase validation (optional)
Field validation (required, options, existence)
Dynamic handling for attachments vs standard fields
Execution of GraphQL mutations per field
- Parameters:
card_id (str) – str = Card identifier
fields (Dict[str, Any]) – dict[str, Any] = Mapping of field_id to new values
expected_phase_id (str | None) – Optional[str] = Expected phase ID for validation
config (CardUpdateConfig | None) – Optional[CardUpdateConfig] = Optional flow configuration
extra_rules (List[BaseRule] | None) – Optional[list[BaseRule]] = Optional custom validation rules
extra_handlers (Dict[str, BaseCardFieldUpdateHandler] | None)
- Returns:
dict = Aggregated API responses per field
- Raises:
ValidationError – When input parameters are invalid
InvalidPhaseError – When card is not in expected phase
FieldNotInPhaseError – When field does not belong to phase
RequiredFieldError – When required field is empty
InvalidFieldOptionError – When value is not allowed
RequestError – When API request fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service._buildAttachmentMutation) True
- Return type:
- updateAssigneeIds(card_id, assignee_ids)[source]¶
Update the assignees of a card.
This method executes a GraphQL mutation to assign one or more users to a card.
- Parameters:
- Returns:
dict = Raw API response containing updated card data
- Raises:
ValidationError – When card_id is empty
ValidationError – When assignee_ids is not a list of strings
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.updateAssigneeIds) True
- Return type:
- updateLabelIds(card_id, label_ids)[source]¶
Update the labels of a card.
This method executes a GraphQL mutation to assign one or more labels to a card.
- Parameters:
- Returns:
dict = Raw API response containing updated card data
- Raises:
ValidationError – When card_id is empty
ValidationError – When label_ids is not a list of strings
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.updateLabelIds) True
- Return type:
- getCardModel(card_id, query_body=None)[source]¶
Retrieve a card as a strongly-typed model.
This method retrieves structured card data and converts it into a Card instance.
- Parameters:
- Returns:
Card = Parsed Card model instance
- Raises:
ValidationError – When card_id is empty
RequestError – When request execution fails
UnexpectedResponseError – When API response is invalid
ParsingError – When response cannot be converted into Card model
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.getCardModel) True
- Return type:
- listAllCardsPaginated(pipe_id, attributes=None)[source]¶
Retrieve all cards from a pipe as typed Card models using pagination.
This method performs cursor-based pagination and converts each card node into a Card model instance.
- Parameters:
- Returns:
list[Card] = List of Card model instances
- Raises:
ValidationError – When pipe_id is empty
ValidationError – When attributes is not a list
UnexpectedResponseError – When API response structure is invalid
ParsingError – When response cannot be converted into Card model
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.listAllCardsPaginated) True
- Return type:
- listCardsFromPhasePaginated(phase_id, limit=50)[source]¶
Retrieve all cards from a specific phase as typed Card models using pagination.
This method performs cursor-based pagination within a phase and converts each card node into a Card model instance.
- Parameters:
- Returns:
list[Card] = List of Card model instances
- Raises:
ValidationError – When phase_id is empty
ValidationError – When limit is not a positive integer
UnexpectedResponseError – When API response structure is invalid
ParsingError – When response cannot be converted into Card model
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.listCardsFromPhasePaginated) True
- Return type:
- class pipebridge.FileService(client, card_service)[source]¶
Bases:
objectApplication service responsible for file operations in Pipefy.
This class acts as the orchestration layer between external interfaces (e.g., Facades) and internal domain flows.
- ARCHITECTURAL ROLE:
Receives structured request objects (DTO pattern)
Delegates execution to domain flows
Manages dependencies and execution context
- DESIGN PRINCIPLES:
No business logic
No parameter explosion
No data transformation logic
Strict delegation to flows
- API DESIGN:
- This service enforces a request-based API:
FileUploadRequest
FileDownloadRequest
- This ensures:
Consistency across operations
Extensibility without breaking signatures
Strong typing and validation
- Parameters:
client (PipefyHttpClient) – PipefyHttpClient = HTTP client instance
card_service (CardService) – CardService = Card service instance
- Raises:
ValidationError – When dependencies are invalid
- Example:
>>> from pipebridge.client.httpClient import PipefyHttpClient >>> from pipebridge.service.card.cardService import CardService >>> client = PipefyHttpClient("token", "https://api.pipefy.com/graphql") >>> service = FileService(client, CardService(client)) >>> isinstance(service, FileService) True
- uploadFile(request, extra_rules=None, config=None, extra_steps_before=None, extra_steps_after=None)[source]¶
Uploads a file and attaches it to a Pipefy card field.
This method delegates execution to FileUploadFlow, which implements a pipeline-based upload mechanism.
- Parameters:
request (FileUploadRequest) – FileUploadRequest = Upload request object
extra_rules (list[BaseRule] | None) – Optional[list[BaseRule]] = Set of custom rules constructed by the user. The rules will be applied before the upload flow.
config (UploadConfig | None) – Optional[UploadConfig] = Configuration for upload process
extra_steps_before (Sequence[BaseStep] | None) – Optional[Sequence[BaseStep]] = Additional custom steps executed before the built-in upload pipeline
extra_steps_after (Sequence[BaseStep] | None) – Optional[Sequence[BaseStep]] = Additional custom steps executed after the built-in upload pipeline
- Returns:
FileUploadResult = Upload result metadata
- Raises:
ValidationError – When request is invalid
FileFlowError – When the upload flow fails in a domain-specific way
WorkflowError – When rule execution or step execution fails at workflow level
RequestError – When a lower-level transport or API failure bubbles up
- Example:
>>> callable(FileService.uploadFile) True
- Return type:
FileUploadResult
- downloadAllAttachments(request)[source]¶
Downloads all attachments from a Pipefy card field.
This method retrieves file URLs from the specified card field, downloads each file, and saves them locally.
- Parameters:
request (FileDownloadRequest) – FileDownloadRequest = Download request object
- Returns:
list[Path] = List of saved file paths
- Raises:
ValidationError – When request is invalid
FileDownloadError – When attachment parsing or binary download fails
RequestError – When a lower-level transport or API failure bubbles up
- Example:
>>> callable(FileService.downloadAllAttachments) True
- Return type:
- class pipebridge.PipeService(client)[source]¶
Bases:
objectService responsible for Pipe operations.
This service follows a layered architecture:
RAW → STRUCTURED → MODEL
It provides a unified and flexible interface to retrieve pipe data, including phases, labels, and users.
- Parameters:
client (PipefyHttpClient) – PipefyHttpClient = HTTP client instance
- getPipeRaw(pipe_id, query_body)[source]¶
Retrieve raw pipe data using a custom GraphQL query.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When pipe_id or query_body is invalid
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PipeService.getPipeRaw) True
- Return type:
- getPipeFieldCatalog(pipe_id)[source]¶
Retrieve all configured phases and fields for a pipe as a model.
This method is intended for field discovery and schema inspection. It returns the canonical Pipe model, with phase fields and start form fields populated from a single pipe schema catalog query.
- Parameters:
pipe_id (str) – str = Pipe identifier
- Returns:
Pipe = Pipe model with phase fields populated
- Raises:
ValidationError – When pipe_id is invalid
ParsingError – When model parsing fails
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PipeService.getPipeFieldCatalog) True
- Return type:
- getPipeStructured(pipe_id, query_body=None)[source]¶
Retrieve structured pipe data.
This method abstracts GraphQL complexity and returns a cleaned, consistent dictionary representing a pipe.
If no query_body is provided, a default query including phases, labels, users, and card count is used.
- Parameters:
- Returns:
dict = Structured pipe data
- Raises:
ValidationError – When pipe_id is invalid
UnexpectedResponseError – When response structure is invalid
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PipeService.getPipeStructured) True
- Return type:
- getPipeModel(pipe_id, query_body=None)[source]¶
Retrieve a Pipe as a strongly-typed model.
This method converts structured pipe data into a Pipe object, enabling direct access to phases, labels, and users without loops.
- Parameters:
- Returns:
Pipe = Parsed Pipe model
- Raises:
ValidationError – When pipe_id is invalid
ParsingError – When model parsing fails
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PipeService.getPipeModel) True
- Return type:
- class pipebridge.PhaseService(client)[source]¶
Bases:
objectService responsible for handling Phase operations.
This service provides methods to retrieve raw, structured, and model-based representations of Pipefy Phases.
- It follows a layered architecture:
RAW → STRUCTURED → MODEL
- Parameters:
client (PipefyHttpClient) – PipefyHttpClient = HTTP client instance
- getPhaseRaw(phase_id, query_body)[source]¶
Retrieve raw phase data using a custom GraphQL query body.
This method provides full flexibility for defining which fields should be retrieved from the Pipefy API.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When phase_id or query_body is invalid
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PhaseService.getPhaseRaw) True
- Return type:
- getPhaseStructured(phase_id, query_body=None)[source]¶
Retrieve structured phase data.
This method abstracts GraphQL complexity and returns a cleaned, consistent dictionary containing the requested phase data.
If no query_body is provided, a default structure including fields metadata is used.
- Parameters:
- Returns:
dict = Structured phase data
- Raises:
ValidationError – When phase_id is invalid
UnexpectedResponseError – When response structure is invalid
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PhaseService.getPhaseStructured) True
- Return type:
- getPhaseModel(phase_id, query_body=None)[source]¶
Retrieve a Phase as a strongly-typed model.
This method converts structured phase data into a Phase object, enabling advanced access patterns such as O(1) field lookup.
- Parameters:
- Returns:
Phase = Parsed Phase model
- Raises:
ValidationError – When phase_id is invalid
ParsingError – When model parsing fails
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PhaseService.getPhaseModel) True
- Return type:
- getPhaseField(phase_id, field_id)[source]¶
Retrieve phase schema metadata for a specific field.
This helper is phase-schema oriented. It does not inspect card payloads and does not depend on whether a field currently has a value in a card.
- requirePhaseField(phase_id, field_id)[source]¶
Retrieve a phase field and fail semantically when it is missing.
- Parameters:
- Returns:
PhaseField = Requested phase field
- Raises:
RequestError – When the field does not exist in the phase schema
- Return type:
PhaseField
- class pipebridge.ConnectorService(client, pipe_service=None, card_service=None)[source]¶
Bases:
objectService responsible for semantic connector discovery.
This service exposes connector-aware schema inspection and dynamic option discovery without requiring consumers to write raw GraphQL.
Connector option discovery is contextual. PipeBridge follows the same cards(… throughConnectors …) pattern used by the Pipefy UI and resolves the repo identifier dynamically from connector schema metadata.
- Parameters:
client (PipefyHttpClient)
pipe_service (Optional[PipeService])
card_service (Optional['CardService'])
- getField(pipe_id, field_id, phase_id=None)[source]¶
Retrieve a connector field specification from a pipe.
- requireField(pipe_id, field_id, phase_id=None)[source]¶
Retrieve a connector field specification and fail when it is missing.
- listOptions(pipe_id, field_id, phase_id=None, search=None, limit=20)[source]¶
List dynamic options exposed by a connector field.
- Parameters:
- Returns:
list[ConnectorOption] = Connector options
- Return type:
List[ConnectorOption]
- resolveOption(pipe_id, field_id, title, phase_id=None)[source]¶
Resolve a connector option by exact title.
Resolution is case-insensitive but exact after trimming. If zero matches are found, or more than one exact match exists, a validation error is raised.
- Parameters:
- Returns:
ConnectorOption = Unique resolved connector option
- Return type:
ConnectorOption
- validateConnectorSelection(field, value)[source]¶
Validate a connector payload against the connector field schema.
First-phase safe creation semantics require connector values to be passed as a list of connected item ids.
Validation performed:
field must be a connector
payload must be a list of non-empty ids
existing-item connection must be allowed
multiplicity must be respected
each id must exist in the connected repo referenced by the field
- getCardValue(card_id, field_id)[source]¶
Retrieve a structured connector value for a card field.
This helper is schema-aware. If the connector exists in the card pipe but is absent from
card.fields, an emptyConnectorValueis returned instead of treating the field as missing.
- addCardValue(card_id, field_id, item_ids)[source]¶
Add connected ids to a connector field using read-modify-write.
- class pipebridge.FileUploadRequest(file_name, file_bytes, card_id, field_id, organization_id, replace_files=False, expected_phase_id=None)[source]¶
Bases:
objectRepresents a file upload request.
This class encapsulates all input data required to execute a file upload operation in Pipefy.
It is designed to:
Eliminate parameter explosion
Improve API readability
Provide validation at construction time
Enable extensibility without breaking method signatures
This object is immutable by design convention and should be treated as a command object.
- Parameters:
file_name (str) – str = Name of the file to upload
file_bytes (bytes) – bytes = Binary content of the file
card_id (str) – str = Pipefy card identifier
field_id (str) – str = Target field identifier
organization_id (str) – str = Pipefy organization identifier
replace_files (bool) – bool = Whether to replace or append existing files
expected_phase_id (str | None) – str | None = Optional current-phase guard. When provided, the upload flow validates that the card is in this phase. When omitted or set to
None, no current-phase validation is executed.
- Raises:
ValidationError – When any parameter is invalid
- Example:
>>> request = FileUploadRequest( ... file_name="file.txt", ... file_bytes=b"data", ... card_id="123", ... field_id="field_1", ... organization_id="org_1" ... ) >>> isinstance(request, FileUploadRequest) True
- classmethod fromFile(file_path, card_id, field_id, organization_id, replace_files=False)[source]¶
Creates a FileUploadRequest from a file path.
- Parameters:
- Returns:
FileUploadRequest
- Raises:
ValidationError – When file_path is invalid
IOError – When file cannot be read
- Example:
>>> import os, tempfile >>> tmp = tempfile.NamedTemporaryFile(delete=False) >>> _ = tmp.write(b"data") >>> tmp.close() >>> req = FileUploadRequest.fromFile(tmp.name, "1", "f", "org") >>> isinstance(req, FileUploadRequest) True
- Return type:
- class pipebridge.FileDownloadRequest(card_id, field_id, output_dir)[source]¶
Bases:
objectRepresents a request to download attachments from a Pipefy card.
This object encapsulates all required parameters for downloading files from a card field.
- DESIGN PURPOSE:
Replace primitive parameter passing
Provide validation at construction time
Improve API consistency with upload flow
- Parameters:
- Raises:
ValidationError – When parameters are invalid
- Example:
>>> req = FileDownloadRequest("1", "field", "/tmp") >>> isinstance(req, FileDownloadRequest) True
- class pipebridge.UploadConfig(retry=None, circuit=None, validate_field_in_current_phase=True)[source]¶
Bases:
objectConfiguration for upload flow execution policies.
This object preserves the existing public API while internally supporting the refactored workflow/policy engine.
- Parameters:
retry (RetryConfig | None) – Optional[RetryConfig] = Retry configuration
circuit (CircuitBreakerConfig | None) – Optional[CircuitBreakerConfig] = Circuit breaker configuration
validate_field_in_current_phase (bool) – bool = Whether upload field existence must be validated strictly against the card current phase schema. When disabled, the field may exist anywhere in the pipe schema, including start form or another phase.
- Example:
>>> cfg = UploadConfig() >>> isinstance(cfg.retry, RetryConfig) True
- class pipebridge.CardUpdateConfig(retry=None, circuit=None, validate_phase=True, validate_field_existence=True, validate_field_options=True, validate_field_type=True, validate_field_format=False, load_phase_schema=False)[source]¶
Bases:
objectConfiguration for card update flows.
- Parameters:
- class pipebridge.CardMoveConfig(retry=None, circuit=None, validate_required_fields=True, load_target_phase_schema=True)[source]¶
Bases:
objectConfiguration for safe card phase transitions.
- Parameters:
retry (RetryConfig | None) – RetryConfig | None = Retry policy configuration
circuit (CircuitBreakerConfig | None) – CircuitBreakerConfig | None = Circuit breaker configuration
validate_required_fields (bool) – bool = Whether the flow must validate required fields from the destination phase before moving the card
load_target_phase_schema (bool) – bool = Whether to load the destination phase schema even when required-field validation is disabled
Facade¶
- class pipebridge.facade.pipefyFacade.CardsFacade(service)[source]¶
Bases:
objectPublic facade for card operations exposed by the SDK.
This facade keeps the public API stable while delegating business logic to
pipebridge.service.card.cardService.CardService.- Parameters:
service (CardService)
- get(card_id)[source]¶
Retrieve a card as a model.
- Important:
card.fieldsreflects thefieldspayload returned by Pipefy for the card query. In practice this should be treated as the set of materialized field values exposed by the API for that card, not as the complete schema of the current phase or the pipe.Use phase or pipe schema helpers when you need to validate field existence independently from the current card payload.
- Parameters:
card_id (str) – str = Card identifier
- Returns:
Card = Card model instance
- Raises:
ValidationError – When input validation fails
ParsingError – When model parsing fails
RequestError – When request execution fails
- Example:
>>> callable(CardsFacade.get) True
- Return type:
- create(pipe_id, title, fields=None)[source]¶
Create a new card.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When input validation fails
RequestError – When a transport or API request fails
- Example:
>>> callable(CardsFacade.create) True
- Return type:
- createSafely(pipe_id, title, fields=None)[source]¶
Create a new card after validating the payload against start form schema.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When input or start form validation fails
RequestError – When a transport or API request fails
- Return type:
- move(card_id, phase_id)[source]¶
Move a card to another phase.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When input validation fails
RequestError – When a transport or API request fails
- Example:
>>> callable(CardsFacade.move) True
- Return type:
- moveSafely(card_id, destination_phase_id, expected_current_phase_id=None, config=None, extra_rules=None)[source]¶
Move a card to another phase after validating transition readiness.
This is the recommended public entry point when the caller wants the SDK to validate destination required fields before moving the card.
- Parameters:
card_id (str) – str = Card identifier
destination_phase_id (str) – str = Destination phase identifier
expected_current_phase_id (str | None) – str | None = Optional expected source phase identifier
config (CardMoveConfig | None) – CardMoveConfig | None = Optional move flow configuration
extra_rules (List[BaseRule] | None) – list[BaseRule] | None = Optional extra rules
- Returns:
dict = Raw move API response
- Return type:
- delete(card_id)[source]¶
Delete a card.
- Parameters:
card_id (str) – str = Card identifier
- Returns:
dict = Raw API response
- Raises:
ValidationError – When input validation fails
RequestError – When a transport or API request fails
- Example:
>>> callable(CardsFacade.delete) True
- Return type:
- list(pipe_id)[source]¶
List all cards from a pipe.
- Parameters:
pipe_id (str) – str = Pipe identifier
- Returns:
list[Card] = List of card models
- Raises:
ValidationError – When input validation fails
ParsingError – When a card model cannot be parsed
UnexpectedResponseError – When the API response structure is invalid
RequestError – When a transport or API request fails
- Example:
>>> callable(CardsFacade.list) True
- Return type:
- search(pipe_id, title)[source]¶
Search cards by title.
- Parameters:
- Returns:
list[dict] = Matching cards
- Raises:
ValidationError – When input validation fails
UnexpectedResponseError – When the API response structure is invalid
RequestError – When a transport or API request fails
- Example:
>>> callable(CardsFacade.search) True
- Return type:
- updateField(card_id, field_id, value, config=None, extra_rules=None, extra_handlers=None)[source]¶
Update a single card field through the public facade.
- Parameters:
card_id (str) – str = Card identifier
field_id (str) – str = Logical field identifier
value (Any) – Any = New field value
config (CardUpdateConfig | None) – CardUpdateConfig | None = Optional update flow configuration
extra_rules (List[BaseRule] | None) – list[BaseRule] | None = Optional custom validation rules
extra_handlers (Dict[str, BaseCardFieldUpdateHandler] | None)
- Returns:
dict = Raw API response keyed by updated field
- Raises:
ValidationError – When input validation fails
WorkflowError – When update workflow execution fails
RequestError – When a transport or API request fails
- Return type:
- updateFields(card_id, fields, expected_phase_id=None, config=None, extra_rules=None, extra_handlers=None)[source]¶
Update multiple card fields through the public facade.
- Parameters:
card_id (str) – str = Card identifier
fields (Dict[str, Any]) – dict[str, Any] = Field values mapped by field ID
expected_phase_id (str | None) – str | None = Optional expected phase ID
config (CardUpdateConfig | None) – CardUpdateConfig | None = Optional update flow configuration
extra_rules (List[BaseRule] | None) – list[BaseRule] | None = Optional custom validation rules
extra_handlers (Dict[str, BaseCardFieldUpdateHandler] | None)
- Returns:
dict = Raw API responses keyed by updated field
- Raises:
ValidationError – When input validation fails
WorkflowError – When update workflow execution fails
RequestError – When a transport or API request fails
- Return type:
- invalidateSchemaCache(pipe_id=None)[source]¶
Invalidate the in-memory pipe schema cache used by card update flows.
- Parameters:
pipe_id (str | None) – str | None = Specific pipe identifier. When omitted, the whole schema cache is invalidated.
- Returns:
None
- Return type:
None
- class pipebridge.facade.pipefyFacade.CardsRawFacade(service)[source]¶
Bases:
objectLow-level card operations (raw GraphQL access).
- Parameters:
service (CardService) – CardService = Card service instance
- Example:
>>> callable(CardsRawFacade.get) True
- get(card_id, query)[source]¶
Retrieve raw card data using custom GraphQL query.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When input validation fails
RequestError – When a transport or API request fails
- Example:
>>> callable(CardsRawFacade.get) True
- Return type:
- class pipebridge.facade.pipefyFacade.CardsStructuredFacade(service)[source]¶
Bases:
objectIntermediate-level card operations (structured response).
- Parameters:
service (CardService) – CardService = Card service instance
- Example:
>>> callable(CardsStructuredFacade.get) True
- get(card_id, query_body=None)[source]¶
Retrieve structured card data.
- Parameters:
- Returns:
dict = Structured response
- Raises:
ValidationError – When input validation fails
UnexpectedResponseError – When the API response structure is invalid
RequestError – When a transport or API request fails
- Example:
>>> callable(CardsStructuredFacade.get) True
- Return type:
- class pipebridge.facade.pipefyFacade.PhasesFacade(service, card_service)[source]¶
Bases:
objectPublic facade for phase retrieval operations.
This facade exposes high-level access to phase data while keeping the underlying service layer internal to the SDK.
- Parameters:
service (PhaseService)
card_service (CardService)
- get(phase_id, query_body=None)[source]¶
Retrieve a phase model.
- Parameters:
- Returns:
Phase = Phase model instance
- Raises:
ValidationError – When phase_id is invalid
ParsingError – When model parsing fails
RequestError – When request execution fails
- Example:
>>> callable(PhasesFacade.get) True
- Return type:
- getField(phase_id, field_id)[source]¶
Retrieve schema metadata for a field inside a specific phase.
This helper is phase-schema oriented. It should be used when the caller needs to know whether a field belongs to a phase regardless of whether a card currently exposes a value for that field.
- class pipebridge.facade.pipefyFacade.PhasesRawFacade(service)[source]¶
Bases:
objectLow-level phase operations (raw GraphQL access).
- Parameters:
service (PhaseService) – PhaseService = Phase service instance
- Example:
>>> callable(PhasesRawFacade.get) True
- get(phase_id, query)[source]¶
Retrieve raw phase data.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When
phase_idorqueryis invalidRequestError – When a transport or API request fails
- Example:
>>> callable(PhasesRawFacade.get) True
- Return type:
- class pipebridge.facade.pipefyFacade.PhasesStructuredFacade(service)[source]¶
Bases:
objectIntermediate-level phase operations (structured response).
- Parameters:
service (PhaseService) – PhaseService = Phase service instance
- Example:
>>> callable(PhasesStructuredFacade.get) True
- get(phase_id, query_body=None)[source]¶
Retrieve structured phase data.
- Parameters:
- Returns:
dict = Structured response
- Raises:
ValidationError – When
phase_idis invalidUnexpectedResponseError – When the API response structure is invalid
RequestError – When a transport or API request fails
- Example:
>>> callable(PhasesStructuredFacade.get) True
- Return type:
- class pipebridge.facade.pipefyFacade.PipesFacade(service)[source]¶
Bases:
objectPublic facade for pipe retrieval and schema discovery operations.
This facade is the recommended entry point for consumers that need pipe models, raw responses, or field catalog discovery.
- Parameters:
service (PipeService)
- get(pipe_id, query_body=None)[source]¶
Retrieve a pipe model.
- Parameters:
- Returns:
Pipe = PipeService model instance
- Raises:
ValidationError – When pipe_id is invalid
ParsingError – When model parsing fails
RequestError – When request execution fails
- Example:
>>> callable(PipesFacade.get) True
- Return type:
- getFieldCatalog(pipe_id)[source]¶
Retrieve all phases and configured fields for a pipe.
This is the discovery-oriented variant of
get(), useful for building update coverage and inspecting the schema available in a pipe.The returned catalog includes:
start form fields
phase fields
connector schema metadata when exposed by Pipefy
- Parameters:
pipe_id (str) – str = Pipe identifier
- Returns:
Pipe = Pipe model with phase fields populated
- Raises:
ValidationError – When pipe_id is invalid
ParsingError – When model parsing fails
RequestError – When request execution fails
- Example:
>>> callable(PipesFacade.getFieldCatalog) True
- Return type:
- class pipebridge.facade.pipefyFacade.PipesRawFacade(service)[source]¶
Bases:
objectLow-level pipe operations (raw GraphQL access).
- Parameters:
service (PipeService) – PipeService = Pipe service instance
- Example:
>>> callable(PipesRawFacade.get) True
- get(pipe_id, query)[source]¶
Retrieve raw pipe data.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When
pipe_idorqueryis invalidRequestError – When a transport or API request fails
- Example:
>>> callable(PipesRawFacade.get) True
- Return type:
- class pipebridge.facade.pipefyFacade.PipesStructuredFacade(service)[source]¶
Bases:
objectIntermediate-level pipe operations (structured response).
- Parameters:
service (PipeService) – PipeService = Pipe service instance
- Example:
>>> callable(PipesStructuredFacade.get) True
- get(pipe_id, query_body=None)[source]¶
Retrieve structured pipe data.
- Parameters:
- Returns:
dict = Structured response
- Raises:
ValidationError – When
pipe_idis invalidUnexpectedResponseError – When the API response structure is invalid
RequestError – When a transport or API request fails
- Example:
>>> callable(PipesStructuredFacade.get) True
- Return type:
- class pipebridge.facade.pipefyFacade.ConnectorsFacade(service)[source]¶
Bases:
objectPublic facade for semantic connector discovery operations.
This facade exposes connector schema inspection and dynamic option discovery without requiring consumers to write raw GraphQL.
- Parameters:
service (ConnectorService)
- getField(pipe_id, field_id, phase_id=None)[source]¶
Retrieve a connector field specification from a pipe.
- requireField(pipe_id, field_id, phase_id=None)[source]¶
Retrieve a connector field specification and fail when it is missing.
- listOptions(pipe_id, field_id, phase_id=None, search=None, limit=20)[source]¶
List connector options from the connected repo.
- Parameters:
- Returns:
list[ConnectorOption] = Connector options
- Return type:
List[ConnectorOption]
- resolveOption(pipe_id, field_id, title, phase_id=None)[source]¶
Resolve a connector option by exact title.
- class pipebridge.facade.pipefyFacade.FilesFacade(service)[source]¶
Bases:
objectFacade for file operations in Pipefy.
This class provides a unified and simplified interface for file upload and download operations.
- DESIGN PRINCIPLES:
Uses request objects (no primitive parameter explosion)
Delegates all logic to FileService
Maintains a stable API boundary
- Parameters:
service (FileService) – FileService
- Example:
>>> callable(FilesFacade.uploadFile) True
- uploadFile(request, extra_rules=None, config=None, extra_steps_before=None, extra_steps_after=None)[source]¶
Uploads a file using a structured request object.
- Parameters:
request (FileUploadRequest) – FileUploadRequest
extra_rules (list[BaseRule] | None) – Optional[list[BaseRule]] = Set of custom rules constructed by te user. The rules will be applied before the upload flow.
config (UploadConfig | None) – Optional[UploadConfig] = Configuration for upload process
extra_steps_before (Sequence[BaseStep] | None) – Optional[Sequence[BaseStep]] = Additional custom steps executed before the built-in upload pipeline
extra_steps_after (Sequence[BaseStep] | None) – Optional[Sequence[BaseStep]] = Additional custom steps executed after the built-in upload pipeline
- Returns:
FileUploadResult
- Raises:
ValidationError – When
requestis invalidFileFlowError – When the upload flow fails semantically
WorkflowError – When a workflow rule or step fails technically
RequestError – When a transport or API request fails
- Example:
>>> callable(FilesFacade.uploadFile) True
- Return type:
FileUploadResult
- downloadAllAttachments(request)[source]¶
Downloads all attachments from a card field.
This method delegates execution to FileService using a structured request object.
- Parameters:
request (FileDownloadRequest) – FileDownloadRequest
- Returns:
list[Path] = List of saved file paths
- Raises:
ValidationError – When
requestis invalidFileDownloadError – When attachment parsing or download fails
RequestError – When a transport or API request fails
- Example:
>>> callable(FilesFacade.downloadAllAttachments) True
- Return type:
- class pipebridge.facade.pipefyFacade.PipeBridge(token, base_url, pipe_schema_cache_ttl_seconds=300, transport_config=None)[source]¶
Bases:
objectRoot public facade of the Pipefy SDK.
This class wires the HTTP client and all domain facades, exposing a cohesive and stable API surface for cards, phases, pipes, and files.
- Parameters:
token (str)
base_url (str)
pipe_schema_cache_ttl_seconds (int)
transport_config (Optional[TransportConfig])
Card Service¶
- class pipebridge.service.card.cardService.CardService(client, pipe_schema_cache_ttl_seconds=300)[source]
Bases:
objectService responsible for card operations in Pipefy.
This service provides a complete abstraction over Pipefy GraphQL for managing cards, including creation, retrieval, updates, and movement across phases.
- param client:
PipefyHttpClient = HTTP client instance
- example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> isinstance(service, CardService) True
- Parameters:
client (PipefyHttpClient)
pipe_schema_cache_ttl_seconds (int)
- invalidatePipeSchemaCache(pipe_id=None)[source]
Invalidate the in-memory pipe schema cache.
- Parameters:
pipe_id (str | None) – str | None = Specific pipe identifier. When omitted, the entire schema cache is invalidated.
- Returns:
None
- Return type:
None
- getPipeSchemaCacheStats()[source]
Retrieve aggregate statistics from the pipe schema cache.
- getPipeSchemaCacheEntryInfo(pipe_id)[source]
Retrieve metadata about a specific cached pipe schema entry.
- createCard(pipe_id, title, fields=None)[source]
Create a new card in a pipe.
This method creates a card in the specified pipe and optionally sets initial field values.
- Parameters:
- Returns:
dict = Raw API response containing created card metadata
- Raises:
ValidationError – When pipe_id or title is empty
ValidationError – When fields is not a dictionary
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.createCard) True
- Return type:
- createCardSafely(pipe_id, title, fields=None)[source]
Create a new card after validating input against the pipe start form schema.
- Parameters:
- Returns:
dict = Raw API response containing created card metadata
- Raises:
ValidationError – When the pipe, title, or field payload is invalid
RequiredFieldError – When a required start form field is missing or empty
InvalidFieldOptionError – When a start form option value is invalid
RequestError – When request execution fails
- Return type:
- getRawCard(card_id, query_body)[source]
Execute a raw GraphQL query for a card.
This method allows full control over the GraphQL query structure.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When card_id or query_body is empty
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.getRawCard) True
- Return type:
- getCardStructured(card_id, query_body=None)[source]
Retrieve structured card data.
This method abstracts GraphQL complexity by providing a default query that includes commonly used fields such as phases, fields, labels, assignees, and attachments.
- Parameters:
- Returns:
dict = Structured card data
- Raises:
ValidationError – When card_id is empty
RequestError – When request execution fails
UnexpectedResponseError – When API response is invalid or missing expected data
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.getCardStructured) True
- Return type:
- getCardPipeField(card_id, field_id)[source]
Retrieve schema metadata for a card field anywhere in the parent pipe.
This helper is schema-oriented. It does not depend on whether the field currently appears in
card.fields.
- getCardCurrentPhaseField(card_id, field_id)[source]
Retrieve schema metadata for a field in the card current phase.
This helper is schema-oriented. It does not depend on whether the field currently appears in
card.fields.
- listCardAttachments(card_id)[source]
Retrieve all attachments exposed by the Pipefy card attachments surface.
This helper is more robust than reading attachment URLs from
card.fieldsbecause it also works for attachment fields that are not materialized in the current card field payload.
- listCardAttachmentsByField(card_id, field_id)[source]
Retrieve attachments associated with a specific field in a card.
- moveCardToPhase(card_id, phase_id)[source]
Move a card to another phase in Pipefy.
This method executes a GraphQL mutation to move a card from its current phase to a destination phase.
- Parameters:
- Returns:
dict = Raw API response containing updated card reference
- Raises:
ValidationError – When card_id or phase_id is empty
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.moveCardToPhase) True
- Return type:
- moveCardToPhaseSafely(card_id, destination_phase_id, expected_current_phase_id=None, config=None, extra_rules=None)[source]
Move a card to another phase after validating transition readiness.
This safe flow can validate destination required fields before executing the low-level move mutation.
- Parameters:
card_id (str) – str = Card identifier
destination_phase_id (str) – str = Destination phase identifier
expected_current_phase_id (str | None) – str | None = Optional expected source phase identifier
config (CardMoveConfig | None) – CardMoveConfig | None = Optional flow configuration
extra_rules (List[BaseRule] | None) – list[BaseRule] | None = Optional additional rules
- Returns:
dict = Raw API move response
- Raises:
ValidationError – When transition validation fails
RequiredFieldError – When destination required fields are still pending
RequestError – When the low-level move request fails
- Return type:
- searchCards(pipe_id, title)[source]
Search for cards in a pipe by title.
This method executes a GraphQL query to find cards whose titles match the provided search term.
- Parameters:
- Returns:
list[dict] = List of card nodes containing basic information (id, title)
- Raises:
ValidationError – When pipe_id or title is empty
UnexpectedResponseError – When API response structure is invalid
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.searchCards) True
- Return type:
- relateCards(parent_id, child_id, source_id)[source]
Create a relationship between two cards in Pipefy.
This method executes a GraphQL mutation to establish a relationship between a parent card and a child card using a Pipe relation.
- Parameters:
- Returns:
dict = Raw API response containing the created relation ID
- Raises:
ValidationError – When parent_id, child_id or source_id is empty
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.relateCards) True
- Return type:
- listAllCards(pipe_id, attributes=None, filters=None, only_phase_name=None)[source]
Retrieve all cards from a pipe using cursor-based pagination.
This method iteratively fetches all cards from a given pipe using GraphQL pagination. It supports optional filtering and phase-based restriction.
- Parameters:
pipe_id (str) – str = Pipe ID from which cards will be retrieved
attributes (List[str] | None) – list[str] | None = List of attributes to include in the query. Defaults to [“id”, “title”]
filters (Dict[str, Any] | None) – dict | None = GraphQL filter object to refine results
only_phase_name (str | None) – str | None = If provided, only cards belonging to this phase name will be returned
- Returns:
list[dict] = List of card nodes matching the query criteria
- Raises:
ValidationError – When pipe_id is empty
ValidationError – When attributes is not a list
UnexpectedResponseError – When API response structure is invalid
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.listAllCards) True
- Return type:
- listCardsFromPhase(phase_id, limit=50)[source]
Retrieve all cards from a specific phase using cursor-based pagination.
This method iteratively fetches cards from a given phase, handling pagination internally until all cards are retrieved.
- Parameters:
- Returns:
list[dict] = List of card nodes containing basic information (id, title)
- Raises:
ValidationError – When phase_id is empty
ValidationError – When limit is not a positive integer
UnexpectedResponseError – When API response structure is invalid
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.listCardsFromPhase) True
- Return type:
- deleteCard(card_id)[source]
Delete a card from Pipefy.
This method executes a GraphQL mutation to permanently remove a card identified by its ID.
- Parameters:
card_id (str) – str = Unique identifier of the card to be deleted
- Returns:
dict = Raw API response indicating operation success
- Raises:
ValidationError – When card_id is empty
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.deleteCard) True
- Return type:
- updateField(card_id, field_id, value, config=None, extra_rules=None, extra_handlers=None)[source]
Update a single field of a card.
This is a convenience wrapper over updateFields.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When card_id or field_id is empty
RequestError – When request execution fails (propagated from updateFields)
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.updateField) True
- Return type:
- updateFields(card_id, fields, expected_phase_id=None, config=None, extra_rules=None, extra_handlers=None)[source]
Updates multiple fields of a card using Pipefy API.
- This method performs:
Phase validation (optional)
Field validation (required, options, existence)
Dynamic handling for attachments vs standard fields
Execution of GraphQL mutations per field
- Parameters:
card_id (str) – str = Card identifier
fields (Dict[str, Any]) – dict[str, Any] = Mapping of field_id to new values
expected_phase_id (str | None) – Optional[str] = Expected phase ID for validation
config (CardUpdateConfig | None) – Optional[CardUpdateConfig] = Optional flow configuration
extra_rules (List[BaseRule] | None) – Optional[list[BaseRule]] = Optional custom validation rules
extra_handlers (Dict[str, BaseCardFieldUpdateHandler] | None)
- Returns:
dict = Aggregated API responses per field
- Raises:
ValidationError – When input parameters are invalid
InvalidPhaseError – When card is not in expected phase
FieldNotInPhaseError – When field does not belong to phase
RequiredFieldError – When required field is empty
InvalidFieldOptionError – When value is not allowed
RequestError – When API request fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service._buildAttachmentMutation) True
- Return type:
- updateAssigneeIds(card_id, assignee_ids)[source]
Update the assignees of a card.
This method executes a GraphQL mutation to assign one or more users to a card.
- Parameters:
- Returns:
dict = Raw API response containing updated card data
- Raises:
ValidationError – When card_id is empty
ValidationError – When assignee_ids is not a list of strings
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.updateAssigneeIds) True
- Return type:
- updateLabelIds(card_id, label_ids)[source]
Update the labels of a card.
This method executes a GraphQL mutation to assign one or more labels to a card.
- Parameters:
- Returns:
dict = Raw API response containing updated card data
- Raises:
ValidationError – When card_id is empty
ValidationError – When label_ids is not a list of strings
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.updateLabelIds) True
- Return type:
- getCardModel(card_id, query_body=None)[source]
Retrieve a card as a strongly-typed model.
This method retrieves structured card data and converts it into a Card instance.
- Parameters:
- Returns:
Card = Parsed Card model instance
- Raises:
ValidationError – When card_id is empty
RequestError – When request execution fails
UnexpectedResponseError – When API response is invalid
ParsingError – When response cannot be converted into Card model
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.getCardModel) True
- Return type:
- listAllCardsPaginated(pipe_id, attributes=None)[source]
Retrieve all cards from a pipe as typed Card models using pagination.
This method performs cursor-based pagination and converts each card node into a Card model instance.
- Parameters:
- Returns:
list[Card] = List of Card model instances
- Raises:
ValidationError – When pipe_id is empty
ValidationError – When attributes is not a list
UnexpectedResponseError – When API response structure is invalid
ParsingError – When response cannot be converted into Card model
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.listAllCardsPaginated) True
- Return type:
- listCardsFromPhasePaginated(phase_id, limit=50)[source]
Retrieve all cards from a specific phase as typed Card models using pagination.
This method performs cursor-based pagination within a phase and converts each card node into a Card model instance.
- Parameters:
- Returns:
list[Card] = List of Card model instances
- Raises:
ValidationError – When phase_id is empty
ValidationError – When limit is not a positive integer
UnexpectedResponseError – When API response structure is invalid
ParsingError – When response cannot be converted into Card model
RequestError – When request execution fails
- Example:
>>> service = CardService(PipefyHttpClient(auth_key="token", base_url="https://api.pipefy.com/graphql")) >>> callable(service.listCardsFromPhasePaginated) True
- Return type:
Phase Service¶
- class pipebridge.service.phase.phaseService.PhaseService(client)[source]
Bases:
objectService responsible for handling Phase operations.
This service provides methods to retrieve raw, structured, and model-based representations of Pipefy Phases.
- It follows a layered architecture:
RAW → STRUCTURED → MODEL
- Parameters:
client (PipefyHttpClient) – PipefyHttpClient = HTTP client instance
- getPhaseRaw(phase_id, query_body)[source]
Retrieve raw phase data using a custom GraphQL query body.
This method provides full flexibility for defining which fields should be retrieved from the Pipefy API.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When phase_id or query_body is invalid
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PhaseService.getPhaseRaw) True
- Return type:
- getPhaseStructured(phase_id, query_body=None)[source]
Retrieve structured phase data.
This method abstracts GraphQL complexity and returns a cleaned, consistent dictionary containing the requested phase data.
If no query_body is provided, a default structure including fields metadata is used.
- Parameters:
- Returns:
dict = Structured phase data
- Raises:
ValidationError – When phase_id is invalid
UnexpectedResponseError – When response structure is invalid
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PhaseService.getPhaseStructured) True
- Return type:
- getPhaseModel(phase_id, query_body=None)[source]
Retrieve a Phase as a strongly-typed model.
This method converts structured phase data into a Phase object, enabling advanced access patterns such as O(1) field lookup.
- Parameters:
- Returns:
Phase = Parsed Phase model
- Raises:
ValidationError – When phase_id is invalid
ParsingError – When model parsing fails
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PhaseService.getPhaseModel) True
- Return type:
- getPhaseField(phase_id, field_id)[source]
Retrieve phase schema metadata for a specific field.
This helper is phase-schema oriented. It does not inspect card payloads and does not depend on whether a field currently has a value in a card.
- hasPhaseField(phase_id, field_id)[source]
Check whether a field exists in a specific phase schema.
- requirePhaseField(phase_id, field_id)[source]
Retrieve a phase field and fail semantically when it is missing.
- Parameters:
- Returns:
PhaseField = Requested phase field
- Raises:
RequestError – When the field does not exist in the phase schema
- Return type:
PhaseField
Pipe Service¶
- class pipebridge.service.pipe.pipeService.PipeService(client)[source]
Bases:
objectService responsible for Pipe operations.
This service follows a layered architecture:
RAW → STRUCTURED → MODEL
It provides a unified and flexible interface to retrieve pipe data, including phases, labels, and users.
- Parameters:
client (PipefyHttpClient) – PipefyHttpClient = HTTP client instance
- getPipeRaw(pipe_id, query_body)[source]
Retrieve raw pipe data using a custom GraphQL query.
- Parameters:
- Returns:
dict = Raw API response
- Raises:
ValidationError – When pipe_id or query_body is invalid
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PipeService.getPipeRaw) True
- Return type:
- getPipeFieldCatalog(pipe_id)[source]
Retrieve all configured phases and fields for a pipe as a model.
This method is intended for field discovery and schema inspection. It returns the canonical Pipe model, with phase fields and start form fields populated from a single pipe schema catalog query.
- Parameters:
pipe_id (str) – str = Pipe identifier
- Returns:
Pipe = Pipe model with phase fields populated
- Raises:
ValidationError – When pipe_id is invalid
ParsingError – When model parsing fails
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PipeService.getPipeFieldCatalog) True
- Return type:
- getPipeStructured(pipe_id, query_body=None)[source]
Retrieve structured pipe data.
This method abstracts GraphQL complexity and returns a cleaned, consistent dictionary representing a pipe.
If no query_body is provided, a default query including phases, labels, users, and card count is used.
- Parameters:
- Returns:
dict = Structured pipe data
- Raises:
ValidationError – When pipe_id is invalid
UnexpectedResponseError – When response structure is invalid
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PipeService.getPipeStructured) True
- Return type:
- getPipeModel(pipe_id, query_body=None)[source]
Retrieve a Pipe as a strongly-typed model.
This method converts structured pipe data into a Pipe object, enabling direct access to phases, labels, and users without loops.
- Parameters:
- Returns:
Pipe = Parsed Pipe model
- Raises:
ValidationError – When pipe_id is invalid
ParsingError – When model parsing fails
RequestError – When an unexpected request-layer failure occurs
- Example:
>>> callable(PipeService.getPipeModel) True
- Return type:
File Service¶
- class pipebridge.service.file.fileService.FileService(client, card_service)[source]
Bases:
objectApplication service responsible for file operations in Pipefy.
This class acts as the orchestration layer between external interfaces (e.g., Facades) and internal domain flows.
- ARCHITECTURAL ROLE:
Receives structured request objects (DTO pattern)
Delegates execution to domain flows
Manages dependencies and execution context
- DESIGN PRINCIPLES:
No business logic
No parameter explosion
No data transformation logic
Strict delegation to flows
- API DESIGN:
- This service enforces a request-based API:
FileUploadRequest
FileDownloadRequest
- This ensures:
Consistency across operations
Extensibility without breaking signatures
Strong typing and validation
- Parameters:
client (PipefyHttpClient) – PipefyHttpClient = HTTP client instance
card_service (CardService) – CardService = Card service instance
- Raises:
ValidationError – When dependencies are invalid
- Example:
>>> from pipebridge.client.httpClient import PipefyHttpClient >>> from pipebridge.service.card.cardService import CardService >>> client = PipefyHttpClient("token", "https://api.pipefy.com/graphql") >>> service = FileService(client, CardService(client)) >>> isinstance(service, FileService) True
- uploadFile(request, extra_rules=None, config=None, extra_steps_before=None, extra_steps_after=None)[source]
Uploads a file and attaches it to a Pipefy card field.
This method delegates execution to FileUploadFlow, which implements a pipeline-based upload mechanism.
- Parameters:
request (FileUploadRequest) – FileUploadRequest = Upload request object
extra_rules (list[BaseRule] | None) – Optional[list[BaseRule]] = Set of custom rules constructed by the user. The rules will be applied before the upload flow.
config (UploadConfig | None) – Optional[UploadConfig] = Configuration for upload process
extra_steps_before (Sequence[BaseStep] | None) – Optional[Sequence[BaseStep]] = Additional custom steps executed before the built-in upload pipeline
extra_steps_after (Sequence[BaseStep] | None) – Optional[Sequence[BaseStep]] = Additional custom steps executed after the built-in upload pipeline
- Returns:
FileUploadResult = Upload result metadata
- Raises:
ValidationError – When request is invalid
FileFlowError – When the upload flow fails in a domain-specific way
WorkflowError – When rule execution or step execution fails at workflow level
RequestError – When a lower-level transport or API failure bubbles up
- Example:
>>> callable(FileService.uploadFile) True
- Return type:
FileUploadResult
- downloadAllAttachments(request)[source]
Downloads all attachments from a Pipefy card field.
This method retrieves file URLs from the specified card field, downloads each file, and saves them locally.
- Parameters:
request (FileDownloadRequest) – FileDownloadRequest = Download request object
- Returns:
list[Path] = List of saved file paths
- Raises:
ValidationError – When request is invalid
FileDownloadError – When attachment parsing or binary download fails
RequestError – When a lower-level transport or API failure bubbles up
- Example:
>>> callable(FileService.downloadAllAttachments) True
- Return type:
Models¶
- class pipebridge.models.card.Card(id, title, pipe_id, current_phase, phases_history, fields, assignees, labels)[source]¶
Bases:
BaseModelRepresents a Pipefy card with full structured data.
This model is the canonical source of truth for current card state inside the SDK. Internal lookup maps are maintained for efficiency, but semantic helper methods should be preferred over direct map access whenever possible.
Important semantic note about
fields:card.fieldsmirrors thefieldscollection returned by the Pipefy card query.This collection should be treated as the set of materialized field values exposed by the API for that card.
It is not a complete schema catalog for the current phase or the pipe.
A field missing from
card.fieldsdoes not imply that the field does not exist in the phase or in the pipe schema.
Preferred access patterns:
getField(...)hasField(...)requireField(...)getFieldValue(...)getFieldType(...)getConnectorIds(...)getConnectedItems(...)iterFields()
- Parameters:
- classmethod fromDict(data)[source]¶
Safely parse a Card from structured dictionary.
This method is resilient to partial failures, null values, and inconsistent API responses. Invalid items are skipped instead of breaking the entire parsing process.
- Parameters:
- Returns:
Card = Parsed Card model
- Raises:
RequestError – When input data is invalid or parsing fails critically
- Example:
>>> data = {"id": "1", "fields": []} >>> card = Card.fromDict(data) >>> isinstance(card, Card) True
- Return type:
- classmethod fromResponse(response)[source]¶
Parse API response into Card model.
- Parameters:
- Returns:
Card
- Raises:
RequestError – When response structure is invalid
RequestError – When parsing fails
- Example:
>>> response = {"data": {"card": {"id": "1"}}} >>> card = Card.fromResponse(response) >>> isinstance(card, Card) True
- Return type:
- getField(field_id)[source]¶
Retrieve a field by its ID.
This is the preferred non-raising accessor for card fields. It only searches inside the
card.fieldspayload returned by Pipefy for this card query.- Parameters:
field_id (str) – str = Field identifier
- Returns:
Field | None = Field if found, otherwise None
- Example:
>>> card = Card.fromDict({"id": "1", "fields": []}) >>> card.getField("x") is None True
- Return type:
Field | None
- hasField(field_id)[source]¶
Check whether a field exists in the current card payload.
This does not validate field existence in the phase schema or pipe schema. It only answers whether the field is present inside the materialized
card.fieldspayload returned by Pipefy.
- requireField(field_id)[source]¶
Retrieve a field and fail semantically when it does not exist.
The existence check is limited to the
card.fieldspayload already materialized for this card.- Parameters:
field_id (str) – str = Field identifier
- Returns:
Field = Requested field
- Raises:
ValidationError – When the field does not exist in the card
- Return type:
Field
- requireFieldValue(field_id)[source]¶
Retrieve the raw value of a field and fail when the field is missing.
The lookup is limited to the
card.fieldspayload already materialized for this card.- Parameters:
field_id (str) – str = Field identifier
- Returns:
Any = Raw field value
- Raises:
ValidationError – When the field does not exist in the card
- Return type:
- iterFields()[source]¶
Return all materialized card fields as an ordered list.
This list reflects the
card.fieldspayload returned by Pipefy. It should not be treated as the complete phase or pipe schema.- Returns:
list[Field] = Card fields
- Return type:
List[Field]
- getConnectorIds(field_id)[source]¶
Retrieve connected repo item identifiers from a connector field.
This only works when the connector field is materialized inside
card.fields.
- hasConnectedItems(field_id)[source]¶
Check whether a connector field materialized connected item metadata.
- getConnectorValue(field_id)[source]¶
Retrieve a structured connector value from the current card payload.
- Parameters:
field_id (str) – str = Connector field identifier
- Returns:
ConnectorValue | None = Structured connector value when available
- Return type:
ConnectorValue | None
- requireFieldType(field_id)[source]¶
Retrieve the field type and fail when it is unavailable.
- Parameters:
field_id (str) – str = Field identifier
- Returns:
str = Field type
- Raises:
ValidationError – When the field is missing or has no type metadata
- Return type:
- getNumber(field_id)[source]¶
Retrieve a numeric field value.
- Parameters:
field_id (str) – str = Field identifier
- Returns:
float | None
- Raises:
ValueError – When value cannot be converted to number
- Example:
>>> card = Card.fromDict({"id": "1", "fields": []}) >>> card.getNumber("x") is None True
- Return type:
float | None
- getLabel(label_id)[source]¶
Retrieve a label by its ID.
- Parameters:
label_id (str) – str = Label identifier
- Returns:
Label | None
- Example:
>>> card = Card.fromDict({"id": "1", "labels": []}) >>> card.getLabel("x") is None True
- Return type:
Label | None
- validateAgainstPhase(phase)[source]¶
Validate card fields against Phase schema, including type validation.
This method ensures: - required fields are present - values match expected field types
- Parameters:
phase (Phase) – Phase = Phase schema
- Returns:
None
- Raises:
ValidationError – When required fields are missing or type validation fails
- Example:
>>> card = Card.fromDict({"id": "1", "fields": []}) >>> phase = Phase.fromDict({"id": "1", "fields": []}) >>> card.validateAgainstPhase(phase)
- Return type:
None
- class pipebridge.models.phase.Phase(id, name=None, fields=None, cards_preview=None, cards_can_be_moved_to_phases=None, next_phase_ids=None)[source]¶
Bases:
BaseModelRepresents a Pipefy Phase with extended metadata.
This model supports full parsing including: - basic info - fields - pipe - cards preview
This model is the canonical representation of phase schema metadata. Its internal maps exist for efficient lookup, but SDK code should prefer semantic helpers instead of direct map access whenever possible.
Preferred access patterns:
getField(...)hasField(...)requireField(...)getFieldType(...)getFieldOptions(...)isFieldRequired(...)getConnectorFields()iterFields()
- Parameters:
- property fields: List[PhaseField]¶
Retrieve all phase fields.
- WARNING:
Prefer using getField() or [] access for O(1) lookup.
- Returns:
list[PhaseField]
- Example:
>>> phase = Phase.fromDict({"id": "1", "fields": []}) >>> isinstance(phase.fields, list) True
- classmethod fromDict(data)[source]¶
Safely parse Phase from structured data.
- Parameters:
- Returns:
Phase
- Raises:
RequestError – When parsing fails
- Example:
>>> phase = Phase.fromDict({"id": "1"}) >>> isinstance(phase, Phase) True
- Return type:
- getField(field_id)[source]¶
Retrieve a field metadata by its identifier.
This is the preferred non-raising accessor for phase schema fields.
- Parameters:
field_id (str) – str = Field identifier
- Returns:
PhaseField | None
- Example:
>>> phase = Phase.fromDict({"id": "1", "fields": []}) >>> phase.getField("x") is None True
- Return type:
PhaseField | None
- requireFieldType(field_id)[source]¶
Retrieve the configured type of a phase field and fail if missing.
- Parameters:
field_id (str) – str = Field identifier
- Returns:
str = Field type
- Raises:
RequestError – When the field does not exist or has no type
- Return type:
- requireFieldOptions(field_id)[source]¶
Retrieve the configured options of a phase field and fail if empty.
- Parameters:
field_id (str) – str = Field identifier
- Returns:
list[str] = Configured field options
- Raises:
RequestError – When the field does not exist or has no configured options
- Return type:
- requireField(field_id)[source]¶
Retrieve a phase field and fail when it does not exist.
- Parameters:
field_id (str) – str = Field identifier
- Returns:
PhaseField = Requested field schema
- Raises:
RequestError – When the field does not exist in the phase
- Return type:
PhaseField
- iterFields()[source]¶
Return all phase fields as an ordered list.
- Returns:
list[PhaseField] = Phase fields
- Return type:
List[PhaseField]
- canMoveToPhase(phase_id)[source]¶
Check whether cards from this phase can be moved to a destination.
- class pipebridge.models.pipe.Pipe(id, name=None, cards_count=0, organization_id=None, start_form_fields=None, phases=None, labels=None, users=None)[source]¶
Bases:
BaseModelRepresents a Pipefy Pipe with structured and efficient access to its related entities.
- This model provides:
O(1) access to phases, labels, and users
Resilient parsing from API responses
Consistent interface aligned with Card and Phase models
The Pipe acts as an entry point to navigate its internal structure without requiring manual iteration. Internal maps are kept for efficient lookup, but semantic helper methods should be preferred over direct map access in SDK code.
Preferred access patterns:
getPhase(...)hasPhase(...)requirePhase(...)iterPhases()getStartFormField(...)iterStartFormFields()iterStartFormConnectorFields()getLabel(...)requireLabel(...)iterLabels()getUser(...)requireUser(...)iterUsers()iterAllFields()getFieldsByType(...)getConnectorFields()
- Parameters:
id (str) – str = Unique identifier of the pipe
name (str | None) – str | None = Human-readable name of the pipe
phases (List[Phase] | None) – list[Phase] | None = List of pipe phases
labels (List[Label] | None) – list[Label] | None = List of pipe labels
users (List[User] | None) – list[User] | None = List of pipe users
cards_count (int)
organization_id (str | None)
start_form_fields (List[PhaseField] | None)
- Example:
>>> pipe = Pipe(id="1", name="Sales") >>> pipe.id '1'
- classmethod fromDict(data)[source]¶
Create a Pipe instance from structured API data.
- This method performs resilient parsing:
Ignores invalid nested items
Tracks parsing issues in _parse_errors
Prevents full failure due to partial inconsistencies
- Parameters:
- Returns:
Pipe = Parsed Pipe model
- Raises:
RequestError – When input data is invalid or parsing fails critically
- Example:
>>> pipe = Pipe.fromDict({"id": "1"}) >>> isinstance(pipe, Pipe) True
- Return type:
- property start_form_fields: List[PhaseField]¶
Retrieve all start form fields associated with the pipe.
- Returns:
list[PhaseField] = Start form fields
- property phases: List[Phase]¶
Retrieve all phases associated with the pipe.
- WARNING:
Prefer using getPhase() or [] access for O(1) lookup.
- Returns:
list[Phase] = List of phases
- Example:
>>> pipe = Pipe.fromDict({"id": "1", "phases": []}) >>> isinstance(pipe.phases, list) True
- property labels: List[Label]¶
Retrieve all labels associated with the pipe.
- WARNING:
Prefer using getLabel() for direct access.
- Returns:
list[Label]
- Example:
>>> pipe = Pipe.fromDict({"id": "1", "labels": []}) >>> isinstance(pipe.labels, list) True
- property users: List[User]¶
Retrieve all users associated with the pipe.
- WARNING:
Prefer using getUser() for direct access.
- Returns:
list[User]
- Example:
>>> pipe = Pipe.fromDict({"id": "1", "users": []}) >>> isinstance(pipe.users, list) True
- getStartFormField(field_id)[source]¶
Retrieve a start form field by its identifier.
- Parameters:
field_id (str) – str = Field identifier
- Returns:
PhaseField | None = Start form field when found
- Return type:
PhaseField | None
- requireStartFormField(field_id)[source]¶
Retrieve a start form field and fail when it does not exist.
- Parameters:
field_id (str) – str = Field identifier
- Returns:
PhaseField = Requested field
- Raises:
RequestError – When the field does not exist in the start form
- Return type:
PhaseField
- iterStartFormFields()[source]¶
Return all start form fields as an ordered list.
- Returns:
list[PhaseField] = Start form fields
- Return type:
List[PhaseField]
- iterStartFormConnectorFields()[source]¶
Return all connector fields configured in the start form.
- Returns:
list[PhaseField] = Start form connector fields
- Return type:
List[PhaseField]
- requirePhase(phase_id)[source]¶
Retrieve a phase and fail when it does not exist.
- Parameters:
phase_id (str) – str = Phase identifier
- Returns:
Phase = Requested phase
- Raises:
RequestError – When the phase does not exist in the pipe
- Return type:
- getField(field_id)[source]¶
Retrieve a field from the pipe schema regardless of origin.
Lookup order:
start form fields
phase fields
- Parameters:
field_id (str) – str = Field identifier
- Returns:
PhaseField | None = Matching field when found
- Return type:
PhaseField | None
- requireField(field_id)[source]¶
Retrieve a field from the pipe schema and fail when missing.
- Parameters:
field_id (str) – str = Field identifier
- Returns:
PhaseField = Requested field
- Raises:
RequestError – When the field does not exist in the pipe schema
- Return type:
PhaseField
- getFieldsByType(field_type)[source]¶
Retrieve all start form and phase fields matching a given type.
- getConnectorFields()[source]¶
Retrieve all connector fields across start form and phases.
- Returns:
list[PhaseField] = Connector field schemas
- Return type:
List[PhaseField]
- getLabel(label_id)[source]¶
Retrieve a label by its identifier.
- Parameters:
label_id (str) – str = Label identifier
- Returns:
Label | None
- Example:
>>> pipe = Pipe.fromDict({"id": "1", "labels": []}) >>> pipe.getLabel("x") is None True
- Return type:
Label | None
- requireLabel(label_id)[source]¶
Retrieve a label and fail when it does not exist.
- Parameters:
label_id (str) – str = Label identifier
- Returns:
Label = Requested label
- Raises:
RequestError – When the label does not exist in the pipe
- Return type:
Label
- iterLabels()[source]¶
Return all labels as an ordered list.
- Returns:
list[Label] = Pipe labels
- Return type:
List[Label]
- getUser(user_id)[source]¶
Retrieve a user by its identifier.
- Parameters:
user_id (str) – str = User identifier
- Returns:
User | None
- Example:
>>> pipe = Pipe.fromDict({"id": "1", "users": []}) >>> pipe.getUser("x") is None True
- Return type:
User | None
- getUserByName(user_name)[source]¶
Retrieve a user by human-readable name using case-insensitive matching.
- Parameters:
user_name (str) – str = User display name
- Returns:
User | None = Matching user when found
- Return type:
User | None
- requireUserByName(user_name)[source]¶
Retrieve a user by name and fail when it does not exist.
- Parameters:
user_name (str) – str = User display name
- Returns:
User = Requested user
- Raises:
RequestError – When the user does not exist in the pipe user list
- Return type:
User
- requireUser(user_id)[source]¶
Retrieve a user and fail when it does not exist.
- Parameters:
user_id (str) – str = User identifier
- Returns:
User = Requested user
- Raises:
RequestError – When the user does not exist in the pipe
- Return type:
User
Exceptions¶
- exception pipebridge.exceptions.PipefyError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
ExceptionBase exception for all Pipefy SDK errors.
This base class keeps backward compatibility with the original
class_name/method_nameformat while also enriching exceptions with metadata that can be used by retry policies, logging, debugging, and higher-level orchestration layers.- Parameters:
message (str) – str = Human-readable error description
class_name (Optional[str]) – Optional[str] = Origin class name
method_name (Optional[str]) – Optional[str] = Origin method name
error_code (Optional[str]) – Optional[str] = Stable machine-readable error code
context (Optional[Mapping[str, Any]]) – Optional[Mapping[str, Any]] = Structured error context
cause (Optional[Exception]) – Optional[Exception] = Original exception cause
retryable (Optional[bool]) – bool = Indicates whether the failure is transient
- Return type:
None
- exception pipebridge.exceptions.ValidationError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
PipefyErrorBase exception for validation failures.
This type represents user input or domain-state violations detected before or during SDK execution.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.InvalidPhaseError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
ValidationErrorRaised when a card is not in the expected phase.
- Example:
>>> isinstance(InvalidPhaseError("error"), InvalidPhaseError) True
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.FieldNotInPhaseError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
ValidationErrorRaised when a field does not belong to the current phase.
- Example:
>>> isinstance(FieldNotInPhaseError("error"), FieldNotInPhaseError) True
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.InvalidFieldOptionError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
ValidationErrorRaised when a field value is not within the allowed options.
- Example:
>>> isinstance(InvalidFieldOptionError("error"), InvalidFieldOptionError) True
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.RequiredFieldError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
ValidationErrorRaised when a required field is missing or empty.
- Example:
>>> isinstance(RequiredFieldError("error"), RequiredFieldError) True
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.ParsingError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
PipefyErrorRaised when parsing data fails.
- exception pipebridge.exceptions.UnexpectedResponseError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
PipefyErrorRaised when API response structure is invalid.
- exception pipebridge.exceptions.RequestError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
PipefyErrorRaised when an API request fails.
- exception pipebridge.exceptions.IntegrationError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
PipefyErrorRaised when external integrations fail.
- exception pipebridge.exceptions.TransportError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
RequestErrorBase exception for transport-level failures.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.TimeoutRequestError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
TransportErrorRaised when a network request exceeds the configured timeout.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.ConnectionRequestError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
TransportErrorRaised when the SDK cannot establish or maintain a connection.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.RateLimitRequestError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
TransportErrorRaised when the API denies the request due to rate limiting.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.TransportAuthenticationError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
AuthenticationErrorRaised when a transport request fails due to authentication.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.TransportInvalidTokenError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
InvalidTokenErrorRaised when the provided Pipefy token is invalid.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.TransportUnauthorizedError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
UnauthorizedErrorRaised when the authenticated principal lacks permission.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.TransportUnexpectedResponseError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
UnexpectedResponseErrorRaised when a transport response cannot be interpreted safely.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.AuthenticationError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
PipefyErrorBase exception for authentication failures.
This category groups all token and authorization problems raised by the SDK when communicating with Pipefy.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.MissingTokenError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
AuthenticationErrorRaised when an authentication token is missing.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.InvalidTokenError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
AuthenticationErrorRaised when an authentication token is invalid.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.ExpiredTokenError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
AuthenticationErrorRaised when an authentication token has expired.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.UnauthorizedError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
AuthenticationErrorRaised when the caller is authenticated but not authorized.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.ConfigurationError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
PipefyErrorBase exception for invalid SDK configuration.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.PipefyInitializationError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
ConfigurationErrorRaised when SDK initialization fails.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.MissingBaseUrlError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
ConfigurationErrorRaised when
base_urlis not provided.- Parameters:
- Return type:
None
- exception pipebridge.exceptions.WorkflowError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
PipefyErrorBase exception for workflow execution failures.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.RuleExecutionError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
WorkflowErrorRaised when a workflow rule fails technically during execution.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.StepExecutionError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
WorkflowErrorRaised when a workflow step fails technically during execution.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.RetryExhaustedError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
WorkflowErrorRaised when retry attempts are exhausted.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.CircuitBreakerOpenError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
WorkflowErrorRaised when a circuit breaker blocks step execution.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.PipefyAPIError(message, errors=None, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
PipefyErrorRaised when Pipefy returns an explicit API-level error payload.
- Parameters:
- Example:
>>> isinstance(PipefyAPIError("error"), PipefyAPIError) True
- Return type:
None
- exception pipebridge.exceptions.FileUploadError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
RequestErrorLegacy-compatible base exception for upload flow failures.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.FileAttachError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
FileUploadErrorRaised when attaching uploaded files to a card fails.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.FileValidationError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
FileUploadErrorRaised when file input validation fails.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.FileFlowError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
FileUploadErrorBase exception for file flow failures.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.PresignedUrlCreationError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
FileFlowErrorRaised when the SDK cannot obtain a presigned upload URL.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.FileTransferError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
FileFlowErrorRaised when binary upload/download transfer fails.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.AttachmentMergeError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
FileFlowErrorRaised when attachment state cannot be merged safely.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.AttachmentUpdateError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
FileAttachErrorRaised when the attachment field cannot be updated in Pipefy.
- Parameters:
- Return type:
None
- exception pipebridge.exceptions.FileDownloadError(message, class_name=None, method_name=None, *, error_code=None, context=None, cause=None, retryable=None)[source]¶
Bases:
RequestErrorRaised when attachment download flow fails.
- Parameters:
- Return type:
None