﻿# SCHEDULE_FUNCTION_INVALID_RESULT — scheduled-transition Function returned an unusable result

A `TransitionSchedule.function` callout must return `resultKind: \Schedule\` with a value shaped `{fireAt|fireAfterMs, expireAt?|expireAfterMs?}` — exactl…

<em>cyoda-go version <a href="https://github.com/Cyoda/cyoda-go/releases/tag/v0.8.3">0.8.3</a></em>

# errors.SCHEDULE_FUNCTION_INVALID_RESULT

## NAME

SCHEDULE_FUNCTION_INVALID_RESULT — a scheduled transition's arm-time Function callout completed, but the engine could not interpret its result as a `Schedule`.

## SYNOPSIS

HTTP: `500` `Internal Server Error`. Retryable: `no`.

## DESCRIPTION

A `TransitionSchedule.function` callout must return `resultKind: "Schedule"` with a value shaped `{fireAt|fireAfterMs, expireAt?|expireAfterMs?}` — exactly one of `fireAt`/`fireAfterMs`, and at most one of `expireAt`/`expireAfterMs`. This error is raised when the compute node returns a different `resultKind`, or a `Schedule` value that is malformed: missing or duplicate fire/expiry fields, an unknown field, or a non-numeric value.

A `fireAt` in the past is not an error — the transition is armed to fire immediately. Only a resolved expiry at or before the resolved fire time is treated as a distinct outcome (the arm is skipped and any prior scheduling for the transition is cancelled), not as this error.

The failure is in the compute node's implementation, not the caller's request — the entity write that triggered arming is rejected so no state change commits against an unschedulable transition. Fix the Function's response shape; do not retry until it is corrected.

## SEE ALSO

- errors
- errors.DISPATCH_TIMEOUT
- errors.CONDITION_TYPE_MISMATCH

## See also

- [`cyoda help errors`](/help/errors/) — Every error response from the Cyoda REST API carries a structured `errorCode` in the `properties` object. Multiple codes may share the same HTTP status. Programmatic handling keys on `errorCode`, not HTTP status.
- [`cyoda help errors DISPATCH_TIMEOUT`](/help/errors/dispatch_timeout/) — A workflow processor or criteria evaluation was dispatched to a compute member but the response did not arrive within the dispatch timeout window. The underlying task may or may not have completed on the remote node.
- [`cyoda help errors CONDITION_TYPE_MISMATCH`](/help/errors/condition_type_mismatch/) — Validation is parse-based: a comparison or range operand is rejected only when it parses into none of the field's declared DataTypes. For example `"abc"` against a DOUBLE field is rejected — it is not a number. A numeric-looking string against a polymorphic `[INTEGER, STRING]` field is accepted (it parses as STRING).

## Raw formats

- [`/help/errors/schedule_function_invalid_result.json`](/help/errors/schedule_function_invalid_result.json) — full descriptor (matches `GET /help/{topic}` envelope)
- [`/help/errors/schedule_function_invalid_result.md`](/help/errors/schedule_function_invalid_result.md) — body only