Skip to content

Errors ​

Match an error with errors.Is or errors.As. The sentinel is the stable part. The text can change.

Setup ​

You observeSentinel or causeWhat to do
New returns an error about MaxConnsThe pool is smaller than the completion slots plus 6.Raise MaxConns, or lower WithWorkers or WithTxSlots.
New returns an error about isolationThe pool default is not READ COMMITTED.Set default_transaction_isolation=read committed on the pool.
Start returns ErrProducerOnlyThe client has no handlers.Register handlers on the worker. Use this client only to submit work.

Migrate is safe to call at each process start. A second call applies only a pending migration.

Submit and enqueue ​

You observeSentinelMeaning
errors.As yields *DuplicateErrorErrDuplicateAn active run already holds this unique key. RunID on the error is that run.
errors.As yields *SubmitConflictErrorErrSubmitConflictThis submit-once key already belongs to a run with a different input.
errors.As yields *PayloadTooLargeErrorErrPayloadTooLargeThe encoded input or output is over the limit.
A builder returns several errorsThe error from SubmitSubmit reports every builder error. The run is not inserted.

A method that ends in Tx inserts the run in your transaction. The run is visible after you commit. Wait after the commit. For a wakeup at commit, use TrackWakeups and call PublishWakeups after the commit.

Wait for a run ​

You observeSentinelMeaning
Result or Output failsErrRunNotCompletedThe run is failed or cancelled.
Output failsErrNotCompletedThat node is not complete yet.
Output failsErrNoOutputThe node completed and stored no output. A run from Define has no result node.
Open on a definition failsErrRunMismatchThe stored run is a different workflow, kind, or kind version.
Any read failsErrRunNotFoundNo row has this run ID.

Wait returns the terminal status. A failed run is not an error from Wait. Read State.

A cancel of the context that you give to Result or Wait returns the context error. The run continues.

Control a run ​

CallSentinelWhen
Cancel, Signal, PauseErrAlreadyTerminalThe run is already terminal. The CLI cancel command exits 0 in this case.
PauseErrAlreadyPausedThe run is already paused.
ResumeErrNotPausedThe run is not paused.
SignalErrSignalNotDeclaredThis run has no wait for that signal name.
RetryErrNotFailedThe run is not failed.
RetryErrNoExhaustedNodeThat node is not an exhausted step.
RetryErrChildNotRetryableThe child run cannot start again.
PauseSchedule and ResumeScheduleErrScheduleNotFoundNo schedule has this ID. Unschedule is PauseSchedule.

WithErrorHandler receives ErrRunDeadlineExceeded when a run deadline discards a step. It receives ErrReclaimLimitExceeded when a step passes WithMaxReclaims.

Next ​

Cyclone stores each run in Postgres.