Skip to content

API Reference parrot_tools.interfaces.workday.service

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.interfaces.workday.service

View source

WorkdayService — self-contained Workday operational interface.

Usable without any FlowComponent (G2). Implements the operational core: OAuth/Basic-auth lifecycle (via SOAPClient), WSDL routing, eager handler registry, and the four public data methods.

Public API

  • fetch(operation_type, **params) -> pd.DataFrame — dispatch to handler
  • fetch_models(operation_type, **params) -> list — typed Pydantic (C7)
  • get_custom_report(report_name, ...) -> pd.DataFrame — RaaS custom report
  • call_operation(operation, **kwargs) — raw SOAP (for handlers)
  • start() / close() — lifecycle (from SOAPClient)

Auth branching

Reproduces workday.py:362-445 exactly:

  • REST custom report (custom_report, custom_punch_field_report_rest, extract_*) → Basic Auth (report_username / report_password).
  • SOAP custom report (anything ending in _report that is not a REST custom report) → OAuth + Proxy_User_Name in SOAP body.
  • Everything else → OAuth only.

Alias Applicant

Re-exported from parrot_tools.interfaces.workday.models.applicant.Applicant.

Alias ApplicantType

Re-exported from parrot_tools.interfaces.workday.handlers.ApplicantType.

Alias Candidate

Re-exported from parrot_tools.interfaces.workday.models.candidate.Candidate.

Alias CandidateType

Re-exported from parrot_tools.interfaces.workday.handlers.CandidateType.

Alias ClockEvent

Re-exported from parrot_tools.interfaces.workday.models.clock_event.ClockEvent.

Alias CompanyPaymentDatesType

Re-exported from parrot_tools.interfaces.workday.handlers.CompanyPaymentDatesType.

Alias CostCenter

Re-exported from parrot_tools.interfaces.workday.models.cost_center.CostCenter.

Alias CostCenterType

Re-exported from parrot_tools.interfaces.workday.handlers.CostCenterType.

Alias CustomPunchFieldReportRestType

Re-exported from parrot_tools.interfaces.workday.handlers.CustomPunchFieldReportRestType.

Alias CustomPunchFieldReportType

Re-exported from parrot_tools.interfaces.workday.handlers.CustomPunchFieldReportType.

Alias CustomReportType

Re-exported from parrot_tools.interfaces.workday.handlers.CustomReportType.

Alias GetOrganization

Re-exported from parrot_tools.interfaces.workday.handlers.organization_single.GetOrganization.

Alias ImportReportedTimeBlocksType

Re-exported from parrot_tools.interfaces.workday.handlers.ImportReportedTimeBlocksType.

Alias ImportTimeClockEventsType

Re-exported from parrot_tools.interfaces.workday.handlers.ImportTimeClockEventsType.

Alias JobChange

Re-exported from parrot_tools.interfaces.workday.models.worker_event.JobChange.

Alias JobPosting

Re-exported from parrot_tools.interfaces.workday.models.job_posting.JobPosting.

Alias JobPostingSite

Re-exported from parrot_tools.interfaces.workday.models.job_posting_site.JobPostingSite.

Alias JobPostingSiteType

Re-exported from parrot_tools.interfaces.workday.handlers.JobPostingSiteType.

Alias JobPostingType

Re-exported from parrot_tools.interfaces.workday.handlers.JobPostingType.

Alias JobRequisition

Re-exported from parrot_tools.interfaces.workday.models.job_requisition.JobRequisition.

Alias JobRequisitionType

Re-exported from parrot_tools.interfaces.workday.handlers.JobRequisitionType.

Alias Location

Re-exported from parrot_tools.interfaces.workday.models.location.Location.

Alias LocationHierarchyAssignmentsType

Re-exported from parrot_tools.interfaces.workday.handlers.location_hierarchy_assignments.LocationHierarchyAssignmentsType.

Alias LocationType

Re-exported from parrot_tools.interfaces.workday.handlers.LocationType.

Alias Organization

Re-exported from parrot_tools.interfaces.workday.models.organizations.Organization.

Alias OrganizationType

Re-exported from parrot_tools.interfaces.workday.handlers.OrganizationType.

Alias PayrollBalancesType

Re-exported from parrot_tools.interfaces.workday.handlers.PayrollBalancesType.

Alias PayrollResultsType

Re-exported from parrot_tools.interfaces.workday.handlers.PayrollResultsType.

Alias PutTimeClockEventsType

Re-exported from parrot_tools.interfaces.workday.handlers.PutTimeClockEventsType.

Alias RecruitingAgencyUsersType

Re-exported from parrot_tools.interfaces.workday.handlers.RecruitingAgencyUsersType.

Alias ReferencesType

Re-exported from parrot_tools.interfaces.workday.handlers.ReferencesType.

Alias ReportedTimeBlock

Re-exported from parrot_tools.interfaces.workday.models.clock_event.ReportedTimeBlock.

Alias RequestTimeOffType

Re-exported from parrot_tools.interfaces.workday.handlers.RequestTimeOffType.

Alias TimeBlock

Re-exported from parrot_tools.interfaces.workday.models.time_block.TimeBlock.

Alias TimeBlockReportType

Re-exported from parrot_tools.interfaces.workday.handlers.TimeBlockReportType.

Alias TimeBlockType

Re-exported from parrot_tools.interfaces.workday.handlers.TimeBlockType.

Alias TimeOffBalance

Re-exported from parrot_tools.interfaces.workday.models.time_off_balance.TimeOffBalance.

Alias TimeOffBalanceType

Re-exported from parrot_tools.interfaces.workday.handlers.TimeOffBalanceType.

Alias TimeOffEligibility

Re-exported from parrot_tools.interfaces.workday.models.time_off_eligibility.TimeOffEligibility.

Alias TimeOffEligibilityType

Re-exported from parrot_tools.interfaces.workday.handlers.TimeOffEligibilityType.

Alias TimeRequest

Re-exported from parrot_tools.interfaces.workday.models.time_request.TimeRequest.

Alias TimeRequestType

Re-exported from parrot_tools.interfaces.workday.handlers.TimeRequestType.

Alias WorkdayConfig

Re-exported from parrot_tools.interfaces.workday.config.WorkdayConfig.

Alias WorkdayReference

Re-exported from parrot_tools.interfaces.workday.models.reference.WorkdayReference.

Class WorkdayService

Workday operational interface — composable without a FlowComponent.

Example::

async with WorkdayService(config=WorkdayConfig()) as svc:
    df = await svc.fetch("get_workers")
Parameter Type Default Description
config WorkdayConfig | None None Explicit credentials / tenant. None → falls back to the WORKDAY_* settings in parrot.conf (G3).
operation_type str 'get_workers' Determines the WSDL to load. Defaults to "get_workers" (staffing WSDL).
**kwargs Any {} Forwarded to SOAPClient.__init__ (e.g. redis_url).

Attributes:

Attribute Type Description
tenant str
report_owner str
workday_url str
metrics dict[str, Any]

Method WorkdayService.call_operation

Raw SOAP invoke — the single choke point for all handlers (G4).

Delegates directly to SOAPClient.run without any dispatch logic. Handlers will call this after TASK-104 rebase.

call_operation(operation: str, **kwargs: Any) -> Any

Parameter Type Default Description
operation str Zeep operation name (e.g. "Get_Workers").
**kwargs Any {} SOAP request body fields forwarded to Zeep.

Returns: Any — The raw Zeep response object.

Method WorkdayService.fetch

Dispatch to the registered handler and return a DataFrame.

Equivalent to the component's dispatch path in run() (workday.py:858). Does NOT inject flow-specific kwargs (masks, storage, dates from YAML attributes); those belong in the thin component (TASK-105).

fetch(operation_type: str, **params: Any) -> pd.DataFrame

Parameter Type Default Description
operation_type str One of the 20 registered operation keys.
**params Any {} Passed directly to handler.execute().

Returns: pd.DataFrame — A pandas.DataFrame with the parsed results.

Raises:

  • ValueError — If the operation_type is not registered.

Method WorkdayService.fetch_models

Typed path returning the underlying Pydantic models (C7).

Fetches via fetch() and reconstructs model instances from the resulting DataFrame rows. After TASK-104 the handlers will expose the internally-built parsed list directly — this implementation is the correct in-spec stand-in for TASK-103.

fetch_models(operation_type: str, **params: Any) -> list

Parameter Type Default Description
operation_type str One of the registered operation keys that has a model class in _OPERATION_MODEL_MAP.
**params Any {} Forwarded to fetch().

Returns: list — list[<ModelClass>] (e.g. list[Worker]) or an empty list for operation types with no mapped model class.

Method WorkdayService.get_custom_report

Execute any Workday RaaS (Reports as a Service) custom report.

Mirrors workday.py:896-957 on the service layer.

get_custom_report(report_name: str, report_owner: str | None = None, **query_params: Any) -> pd.DataFrame

Parameter Type Default Description
report_name str Name of the report in Workday (required). Example: "Extract_Time_Blocks_-_Navigator"
report_owner str | None None Email/ID of the report owner (optional). Defaults to config.report_owner.
**query_params Any {} Any report-specific query parameters (e.g. Start_Date, End_Date, Worker).

Returns: pd.DataFrame — DataFrame with automatic column detection from the JSON response.

Method WorkdayService.put_time_clock_events

Submit clock events via Put_Time_Clock_Events; return per-event status.

Usable standalone without any FlowComponent (G8).

put_time_clock_events(events: list[ClockEvent], *, auto_submit: bool | None = None) -> pd.DataFrame

Parameter Type Default Description
events list[ClockEvent] Validated list of ClockEvent models.
auto_submit bool | None None Optional service-level override for all events' auto_submit flag. When set, every event's auto_submit is replaced with this value before submission.

Returns: pd.DataFrame — DataFrame with columns submitted, event_id, error — one row per input event. event_id echoes the client-assigned Time_Clock_Event_ID (Workday returns no per-event WID).

Method WorkdayService.import_time_clock_events

Batch-import clock events via Import_Time_Clock_Events.

The response is an async Import_Process_Reference (Workday processes it in the background). No terminal-status polling is performed (Non-Goal).

import_time_clock_events(events: list[ClockEvent], *, batch_id: str | None = None) -> pd.DataFrame

Parameter Type Default Description
events list[ClockEvent] Validated list of ClockEvent models.
batch_id str | None None Optional batch identifier forwarded to the SOAP operation.

Returns: pd.DataFrame — DataFrame with submitted/event_id/error; event_id is the same Import_Process_Reference on every row.

Method WorkdayService.import_reported_time_blocks

Import reported time blocks via Import_Reported_Time_Blocks.

import_reported_time_blocks(blocks: list[ReportedTimeBlock]) -> pd.DataFrame

Parameter Type Default Description
blocks list[ReportedTimeBlock] Validated list of ReportedTimeBlock models.

Returns: pd.DataFrame — DataFrame with submitted/event_id/error; event_id is the same Import_Process_Reference on every row.

Method WorkdayService.get_calculated_time_blocks

Typed wrapper over the existing get_time_blocks handler (G3, read-only).

Delegates to the unchanged TimeBlockType handler — no behaviour change to the existing operation.

get_calculated_time_blocks(**criteria: Any) -> pd.DataFrame

Parameter Type Default Description
**criteria Any {} Same keyword arguments as fetch("get_time_blocks", **criteria) (e.g. worker_id, start_date, end_date).

Returns: pd.DataFrame — DataFrame of calculated time blocks.

Method WorkdayService.start

Initialise Redis, OAuth token, and Zeep transport/client.

start(**_kwargs: Any) -> None

Parameter Type Default Description
**_kwargs Any {}

Method WorkdayService.close

Release transport, Redis, and Zeep client.

close() -> None

Method WorkdayService.bind_service

Bind the Zeep service and point it at the configured tenant host.

The shipped WSDLs hardcode the PRODUCTION SOAP endpoint (services1.wd501.myworkday.com). When workday_url selects a different host — e.g. a sandbox/implementation tenant at impl-services1.wd501.myworkday.com — rewrite the endpoint host so SOAP operations (reads AND writes) target the configured environment instead of always hitting production.

Only the scheme + host are swapped; the WSDL path is preserved verbatim, so both the standard /ccx/service/<tenant>/<Service>/<ver> and the longer /ccx/service/customreport2/... forms keep working. For the production default the host already matches, so this is a no-op.

bind_service() -> Any

Returns: Any — The Zeep service proxy, with its endpoint host aligned to self.workday_url.

Method WorkdayService.serialize_object

Custom serialiser that preserves Zeep ID objects.

Verbatim from workday.py:523-536. Parser output depends on this to keep the type / _value_1 structure intact.

serialize_object(obj: Any) -> Any

Parameter Type Default Description
obj Any Any Zeep-serialised value.

Returns: Any — A JSON-friendly structure with Zeep ID objects preserved as {"type": ..., "_value_1": ...} dicts.

Method WorkdayService.split_parts

Divide task_list into num_parts roughly equal sublists.

Verbatim from parrot_tools.interfaces.workday. Called by workers/applicants/job_requisitions handlers for batch processing.

split_parts(task_list: list, num_parts: int = 5) -> list

Parameter Type Default Description
task_list list The sequence to partition.
num_parts int 5 Number of sublists to produce.

Returns: list — A list of num_parts sublists.

Method WorkdayService.add_metric

Store a named metric. Called by handlers to record counts.

add_metric(key: str, value: Any) -> None

Parameter Type Default Description
key str Metric name (e.g. "NUM_WORKERS").
value Any Metric value.

Alias Worker

Re-exported from parrot_tools.interfaces.workday.models.worker.Worker.

Alias WorkerEvent

Re-exported from parrot_tools.interfaces.workday.models.worker_event.WorkerEvent.

Alias WorkerEventHistoryType

Re-exported from parrot_tools.interfaces.workday.handlers.WorkerEventHistoryType.

Alias WorkerJobChangesType

Re-exported from parrot_tools.interfaces.workday.handlers.WorkerJobChangesType.

Alias WorkerType

Re-exported from parrot_tools.interfaces.workday.handlers.WorkerType.

Alias get_wsdl_path

Re-exported from parrot_tools.interfaces.workday.config.get_wsdl_path.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally