Skip to content

Instantly share code, notes, and snippets.

@larohra
Created July 13, 2026 23:53
Show Gist options
  • Select an option

  • Save larohra/6485949df0edbf1dea7280a76271028b to your computer and use it in GitHub Desktop.

Select an option

Save larohra/6485949df0edbf1dea7280a76271028b to your computer and use it in GitHub Desktop.
Entity to Entity Signaling in AFD vs new package

Verdict

azure-functions-durable-python v1.6.0: No. A Python Durable Entity cannot signal itself—or any entity—from entity code, immediately or on a schedule.

microsoft/durabletask-python: Yes, in durabletask>=1.7.0. The current v1.7.2 release supports exactly this pattern.

Capability Azure Functions Python v1.6.0 durabletask v1.7.2
Entity → immediate self-signal No Yes
Entity → scheduled self-signal No Yes
Orchestrator → scheduled entity signal No public API Yes
Client → scheduled entity signal No Yes

Current Azure Functions package

DurableEntityContext exposes only state, input, result, and deletion operations. It has no outbound messaging API.

The other available surfaces are immediate-only:

The official documentation explicitly confirms: “Python doesn't support entity-to-entity signals. Use an orchestrator to signal entities instead.”

Why this is not merely a missing Python method

The Azure Functions extension supports scheduled entity signals for in-process .NET using RequestMessage.ScheduledTime ("due"). However, its out-of-process entity response protocol only accepts:

signals[{ target, name, input }]

There is no scheduled-time field, and the host never copies one into RequestMessage.ScheduledTime. This is tracked by the still-open extension issue #1554: Support Entity-to-Entity Scheduled SignalEntities for OutOfProc PLs.

Therefore, implementing the exact feature in this repository requires coordinated work:

  1. Durable Functions extension: add scheduled time to TaskEntityShim.OutOfProcResult.Signal and propagate it into RequestMessage.ScheduledTime.
  2. Python SDK: add DurableEntityContext.signal_entity, collect outgoing signals, expose self identity, and serialize the scheduled time.
  3. Compatibility protection: older hosts would ignore the new field and deliver the message immediately, so a minimum extension version or capability negotiation is essential.

Adjacent findings:

  • Immediate entity-to-self/entity-to-entity signaling could be added package-only because the existing signals[] protocol already supports it.
  • Scheduled signaling from an orchestrator is already implemented by the host as action type 10, but Python does not expose it.
  • Scheduled signaling through DurableOrchestrationClient would require a small host HTTP endpoint change.

The currently available workaround is an orchestrator:

yield context.create_timer(deadline)
context.signal_entity(entity_id, "wake_up", payload)

That is durable but requires a separate orchestration and cannot be initiated directly by the entity.

New microsoft/durabletask-python package

Support was added in PR #160, shipped in v1.7.0, and remains in the current v1.7.2.

The API is:

ctx.signal_entity(
    ctx.entity_id,
    "wake_up",
    input=payload,
    signal_time=wake_at_utc,
)

EntityContext.signal_entity explicitly documents signal_time as useful “to have an entity wake itself up at a later time.” It serializes to the protobuf SendSignalAction.scheduledTime field.

This is not just an exposed but unused API:

  • The shipped durabletask.scheduled Schedule entity re-arms itself with a future signal_time.
  • Unit tests verify that the self-signal contains scheduledTime.
  • End-to-end tests exercise recurring self-scheduling against both the in-memory backend and the Durable Task Scheduler emulator.

Semantics and constraints

  • It is a one-way, fire-and-forget signal; results and handler errors are not returned.
  • The scheduled time is a not-before deadline, not an exact execution time.
  • Entity operations remain serialized; self-signaling does not invoke the entity reentrantly.
  • There is no cancellation handle. The shipped scheduler uses an execution token so obsolete scheduled signals become no-ops.
  • Deleting state does not reliably cancel an already queued signal; handlers should tolerate stale delivery.
  • Use timezone-aware UTC datetime values.
  • No service-specific maximum delay or minimum DTS version is currently documented.
  • The repository has live DTS coverage, but only against the unpinned dts-emulator:latest.

Most importantly, durabletask-python is explicitly not compatible with Azure Durable Functions. It targets Azure Durable Task Scheduler, so it cannot simply be imported into an existing Functions application.

Recommendation: for Azure Functions, treat this as a coordinated extension + Python SDK feature based on issue #1554. For Durable Task Scheduler workloads, the feature is already available and production-shaped in durabletask>=1.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment