Reference

operations.workQueue queries

Package Trax.Api.GraphQLSurface GraphQL schemaSource WorkQueueQueries.cs

WorkQueueQueries, the type behind operations { workQueue { ... } }.

The operations.workQueue namespace exposes paginated reads of the work queue. The work queue is the intermediary between scheduling and dispatch: every queued execution (manifest triggers, dashboard re-runs, dead-letter requeues, GraphQL queueTrain calls) lands here as a Queued row that the JobDispatcher picks up.

query {
  operations {
    workQueue {
      workQueues(skip: 0, take: 25, status: QUEUED) {
        items {
          id
          externalId
          trainName
          status
          createdAt
          dispatchedAt
          scheduledAt
          priority
          dispatchAttempts
          manifestId
          metadataId
          deadLetterId
          inputTypeName
        }
        totalCount
        isEstimatedCount
        nextCursor
      }
    }
  }
}

workQueues

ParameterTypeDefaultDescription
skipInt!0Number of records to skip (offset pagination). A negative value reads as 0. Ignored when afterId is provided.
takeInt!25Number of records to return, from 1 to 500. See Page size
statusWorkQueueStatusnullFilter by lifecycle state (QUEUED, DISPATCHED, CANCELLED)
trainNameStringnullExact-match filter on the interface FullName (e.g. MyApp.Trains.Billing.IChargeCustomerTrain)
afterIdLongnullKeyset cursor. Returns records with id < afterId. See Pagination
subjectKeyStringnullOnly entries serialized against this subject, matched exactly: a subject's queue, as the dashboard's subject column links to it
manifestIdLongnullOnly entries queued for this manifest, served by ix_work_queue_manifest_id

Returns: PagedResult<WorkQueueSummary>

When any filter or afterId is supplied, the count is exact and isEstimatedCount is false. Unfiltered first-page reads use the same fast estimator as the other large-table queries.

WorkQueueSummary fields

FieldTypeDescription
idLong!Database ID
externalIdString!GUID assigned at creation
trainNameString!Train interface FullName
statusWorkQueueStatus!QUEUED, DISPATCHED, or CANCELLED
createdAtDateTime!When the entry was queued
dispatchedAtDateTimeWhen the dispatcher picked it up (null while queued or if cancelled before dispatch)
scheduledAtDateTimeEarliest dispatch time. Null means dispatch immediately
priorityInt!Dispatch priority 0-31
dispatchAttemptsInt!Number of times dispatch was attempted and failed
manifestIdLongSource manifest ID, if scheduled
metadataIdLongMetadata ID created at dispatch, if dispatched
deadLetterIdLongDead letter that triggered this requeue, if applicable
inputTypeNameStringFully qualified type name of the input, for deserialization
confirmedAtDateTimeWhen the entry became eligible for dispatch. Null while it is still being staged, and stays null on a staged entry that was cancelled (by an operator, or by the stale staged entry sweep); the dispatcher never claims an unconfirmed entry. Also null on an entry dispatched more than a day before the database was migrated to the version that added it, which the migration does not backfill
subjectKeyStringThe subject the entry is serialized against, from the train's QueueSubjectKey. Null when the train does not set one. The value is computed by the consumer's train, so it may carry record identifiers
replayDecisionsOfLongThe execution whose recorded decisions the run this entry starts will replay (a requeue, or a manifest's retry that replays); null when it will ask its questions afresh. Also on detail

detail

Returns one entry with the train input it was queued with and, for a queued entry with a subject, what it is waiting on. Backs a work queue detail page. It reads through IOperationsService.GetWorkQueueEntryDetailAsync, the call the dashboard's work queue entry page makes, so both mask the input and name what the entry waits on the same way.

query {
  operations {
    workQueue {
      detail(id: 42) { id status subjectKey input subjectHeldBy subjectQueuedBehind }
    }
  }
}
ParameterTypeRequiredDescription
idLong!YesThe work queue entry's database ID

Returns: WorkQueueDetail (nullable, returns null if the ID does not exist). It carries every WorkQueueSummary field and:

FieldTypeDescription
inputStringThe train input as stored JSON, with each [TraxSensitive] member masked. Can hold credentials; see Train inputs and the operations gate
subjectHeldByLongFor a queued entry with a subject: the dispatched entry for the same subject whose run is still pending or in progress. Dispatch skips the subject until that run finishes
subjectQueuedBehindLongFor a queued entry with a subject that nothing holds: the queued entry for the same subject that dispatch offers first (confirmed, due, in an enabled group, then higher priority, then older). Dispatch offers one entry per subject each cycle

Both are null for an entry that is not queued or has no subject.

See also