Skip to main content

PayrollExecutionFlow

Guided flow to configure, review, and submit a single payroll.

Remarks

This is the inner flow that powers the back half of Payroll.PayrollFlow, and it is also reused by the off-cycle, dismissal, and transition flows after they have created their respective payrolls. Render it directly when you have built your own payroll-creation step and want to hand the user off to the standard execution experience without re-implementing it. The flow ships with breadcrumb navigation and the standard wire-confirmation UX.

Example

App.tsx
import { Payroll, type EventType } from '@gusto/embedded-react-sdk'

function MyApp() {
return (
<Payroll.PayrollExecutionFlow
companyId="a007e1ab-3595-43c2-ab4b-af7a5af2e365"
payrollId="0987fcea-7b59-4907-a301-f232b5aff508"
onEvent={(eventType: EventType) => {
if (eventType === 'runPayroll/submitted') {
// Payroll submitted — navigate to your next screen
}
}}
/>
)
}

PayrollExecutionFlowProps

Props for PayrollExecutionFlow.

PropertyTypeDescription
companyIdstringThe associated company identifier.
onEventOnEventType<EventType, unknown>Event handler that receives the RUN_PAYROLL_* events emitted during the flow.
payrollIdstringThe identifier of the payroll to execute. The payroll must already exist (e.g. created by a prior creation step or by the standard PayrollFlow selection).
ConfirmWireDetailsComponent?ConfirmWireDetailsComponentTypeOptional custom component to replace the default wire details confirmation UI.
initialPayPeriod?PayrollPayPeriodTypeOptional pay period metadata used to seed breadcrumb labels and date context.
initialState?PayrollExecutionInitialStateWhere the flow starts. Use 'overview' when you want to drop the user directly on the review screen (e.g. resuming an already-calculated payroll). Defaults to 'configuration'.
isDismissalPayroll?booleanWhen true, surfaces dismissal-specific copy and breadcrumbs (used by Payroll.DismissalFlow). Defaults to false.
withReimbursements?booleanOptional flag to show or hide reimbursement fields throughout the flow. Defaults to true.

Events

EventDescriptionData
runPayroll/editFired when user chooses to edit payroll
runPayroll/calculatedFired when payroll calculation completes{ payrollUuid, payPeriod?, alert? }
runPayroll/employee/editFired when user opens an employee row to edit{ employeeId, firstName, lastName }
runPayroll/employee/savedFired when employee edits are saved
runPayroll/employee/cancelledFired when employee edits are cancelled
runPayroll/submittingFired when payroll submission begins
runPayroll/submittedFired when payroll is successfully submittedResponse from the Submit payroll endpoint
runPayroll/processedFired when payroll processing is completed
runPayroll/processingFailedFired when payroll processing failsError details
runPayroll/cancelledFired when a payroll is cancelledResponse from the Cancel payroll endpoint
runPayroll/receipt/getFired when user requests payroll receipt{ payrollId }
runPayroll/receipt/viewedFired when the receipt screen is viewed
runPayroll/pdfPaystub/viewedFired when user views employee paystub PDF{ employeeId }
runPayroll/blockers/viewAllFired when user opens the full blockers list
payroll/saveAndExitFired when user uses the save-and-exit CTA

Sub-components

ComponentDescription
PayrollConfigurationHandles the configuration phase of payroll processing, allowing users to review and modify employee compensation before calculating the payroll.
PayrollOverviewFinal review screen for a calculated payroll before submission, with submit, cancel, and edit controls. After submission, tracks processing status and surfaces the receipt and per-employee paystub downloads once complete.
PayrollEditEmployeeEditor for an individual employee's compensation within a payroll run.
PayrollReceiptsDisplays a detailed receipt for a completed payroll, including the debited total, per-category breakdown, tax breakdown, and a per-employee summary of payment method, garnishments, reimbursements, taxes, and net pay.
PayrollBlockerListDisplays the list of blockers preventing payroll from being processed for a company.

Step flow

The execution flow centers on the configuration step (PayrollConfiguration) as a hub: from there you can edit an employee, view all blockers, or calculate the payroll to reach the overview, and each of those returns to configuration. The one spoke-to-spoke move is overview → receipts (runPayroll/receipt/get); receipts then also returns to the hub. The entry point depends on the initialState prop: 'configuration' (the default) or 'overview' (drop directly onto the review screen for an already-calculated payroll).

Edge labels are dropped for legibility (see the events table above); each spoke's events are: edit an employee (runPayroll/employee/edit, returning on runPayroll/employee/saved / runPayroll/employee/cancelled), view all blockers (runPayroll/blockers/viewAll), and calculate to reach the overview (runPayroll/calculated, returning on runPayroll/edit before submission). Overview reaches receipts on runPayroll/receipt/get.

runPayroll/submitting flips a one-way latch: runPayroll/edit returns to configuration only before submission has started, after which the configuration step is hidden and the flow stays on the overview through submission and processing.

The breadcrumb header (breadcrumb/navigate) returns to an earlier step, and Save & exit (payroll/saveAndExit, the dashed edges to the exit node) is available from every step except employee editing. Neither that event nor the status events emitted during the run (runPayroll/submitted, runPayroll/processed, runPayroll/processingFailed, runPayroll/cancelled) is handled internally — each surfaces on onEvent, with payroll/saveAndExit signalling that the flow has been exited.

Endpoints