Single worker workflow#331
Open
hughneale wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR shifts Temporal execution toward a single-worker/task-queue model and adds provider-level notification workflows/activities so notifications and provider operations can be dispatched through Temporal.
Changes:
- Reworks Temporal client/worker setup from multi-worker identity queues to one configured task queue.
- Adds system workflows, lookup/signaling activities, and provider notify workflows.
- Updates provider interfaces/registrations for runtime-aware workflow/activity registration and notification execution.
Reviewed changes
Copilot reviewed 54 out of 56 changed files in this pull request and generated 22 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/workflows/tasks/providers/thand/revoke.go | Updates revoke child workflow IDs and notification task fields. |
| internal/workflows/tasks/providers/thand/notify.go | Replaces notify activities with provider notify child workflows. |
| internal/workflows/tasks/providers/thand/notify_impl.go | Adds a notification title constant. |
| internal/workflows/tasks/providers/thand/form.go | Updates form notification task field names. |
| internal/workflows/tasks/providers/thand/authorize.go | Updates authorize child workflow IDs and notification task fields. |
| internal/workflows/tasks/providers/thand/approvals.go | Adds disableUI config and notification field updates. |
| internal/workflows/tasks/providers/thand/approval_callback.go | Adds shared approval event source constant. |
| internal/providers/terraform/activities.go | Adds runtime parameter to activity registration. |
| internal/providers/slack/main.go | Adds Temporal activity dispatch for Slack notifications. |
| internal/providers/slack/activities.go | Adds Slack notification activity wrapper. |
| internal/providers/salesforce/activities.go | Adds runtime parameter to activity registration. |
| internal/providers/proxy.go | Adds stub Temporal registration methods for proxy provider. |
| internal/providers/okta/activities.go | Adds runtime parameter to activity registration. |
| internal/providers/kubernetes/activities.go | Adds runtime parameter to activity registration. |
| internal/providers/github/activities.go | Adds runtime parameter to activity registration. |
| internal/providers/gcp/activities.go | Adds runtime parameter to activity registration. |
| internal/providers/email/mock.go | Updates notification signature to ProviderContext. |
| internal/providers/email/main.go | Adds Temporal activity dispatch for email notifications. |
| internal/providers/email/activities.go | Adds email notification activity wrapper. |
| internal/providers/email.smtp/main.go | Updates SMTP notification signature. |
| internal/providers/email.ses/main.go | Updates SES notification context handling. |
| internal/providers/email.acs/main.go | Updates ACS notification context handling. |
| internal/providers/cloudflare/activities.go | Adds runtime parameter to activity registration. |
| internal/providers/azure/activities.go | Adds runtime parameter to activity registration. |
| internal/providers/aws/activities.go | Adds runtime parameter to activity registration. |
| internal/models/temporal.go | Changes Temporal worker interface and adds system workflow names. |
| internal/models/provider.go | Updates provider Temporal registration interface. |
| internal/models/provider_workflows.go | Adds notify workflow, runtime routing, and child ID helper split. |
| internal/models/provider_workflows_childid_test.go | Updates child workflow ID tests for renamed helper. |
| internal/models/provider_temporal.go | Adds notify/lookup constants and registration logging. |
| internal/models/provider_sync.go | Removes unused sync capability parameter. |
| internal/models/provider_notifier.go | Changes notifier context type and adds context helper. |
| internal/models/provider_capabilities.go | Adds capability runtime mode field/default. |
| internal/models/provider_capabilities_test.go | Adds runtime default JSON tests. |
| internal/models/provider_activities.go | Updates activity registration docs/signature. |
| internal/daemon/server.go | Exposes mode in template data. |
| internal/daemon/model.go | Adds mode to simple config model. |
| internal/config/temporal.go | Registers system workflows/activities and adds system workflow startup. |
| internal/config/temporal_workflows.go | Adds server/agent long-running system workflows. |
| internal/config/temporal_activities.go | Adds signal and system identifier lookup activities. |
| internal/config/services/temporal/readiness_test.go | Updates readiness tests for new gating behavior. |
| internal/config/services/temporal/multi_worker.go | Removes multi-worker broadcast implementation. |
| internal/config/services/temporal/main.go | Reworks Temporal client to a single worker/task queue. |
| internal/config/services/temporal/auth_mtls_vault_test.go | Updates Temporal client test constructor call. |
| internal/config/services/temporal/auth_mtls_inline_test.go | Updates Temporal client test constructor call. |
| internal/config/services/temporal/auth_mtls_file_test.go | Updates Temporal client test constructor call. |
| internal/config/services/temporal/auth_apikey_test.go | Updates Temporal client test constructor call. |
| internal/config/services/client.go | Configures a single Temporal task queue by mode. |
| internal/config/providers.go | Registers provider workflows/activities by capability runtime. |
| internal/common/client.go | Adds THAND_AGENT_ID override for client identifier. |
| internal/common/client_test.go | Adds tests for client identifier override. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+249
to
+255
| log.Warn("upsertIdentitiesSearchAttribute called with empty identities; skipping upsert") | ||
| return nil | ||
| } | ||
| log.Info("Upserting identities typed search attribute", | ||
| "Key", sdkConstants.TypedSearchAttributeIdentities.GetName(), | ||
| "Identities", identities, | ||
| ) |
Comment on lines
+504
to
506
| // TODO | ||
| if c.IsServer() || c.IsAgent() || c.IsClient() { | ||
| return providers.CreateInstance(strings.ToLower(providerName)) |
Comment on lines
+26
to
+29
| // DisableUI hides the Approve/Reject controls on the workflow execution | ||
| // page in the UI. Approvals must instead be made through configured | ||
| // notifiers (e.g. Slack, email, local device presence). Defaults to false. | ||
| DisableUI bool `json:"disableUI" default:"false"` |
Comment on lines
+127
to
+128
| Enabled bool `json:"enabled,omitempty"` | ||
| Runtime sdkConstants.Mode `json:"mode,omitempty"` |
Comment on lines
+377
to
+381
| ctx = evaluateRuntime( | ||
| ctx, | ||
| provider.GetCapabilities().Provisioning.Runtime, | ||
| common.GetClientIdentifier().String(), | ||
| ) |
Comment on lines
+208
to
+212
| WorkflowID: models.CreateChildWorkflowID( | ||
| workflowTask.GetWorkflowID(), | ||
| models.TemporalNotifyWorkflowName, | ||
| task.ProviderName, | ||
| task.Recipient, |
Comment on lines
+31
to
+34
| ProviderName string | ||
| Recipient string | ||
| CallFunc model.CallFunction | ||
| Payload models.NotificationRequest |
Comment on lines
+181
to
+183
| log.Info("Starting main system workflow loop") | ||
| for { | ||
| if err := waitForSystemSignalOrCancel(cancelCtx, selector); err != nil { |
Comment on lines
+317
to
+319
| WorkflowID: models.CreateChildWorkflowIDFromRole( | ||
| workflowTask.GetWorkflowID(), | ||
| "authorizeRole", | ||
| models.TemporalAuthorizeRoleWorkflowName, // This can be anything |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #
Type of Change
feat– New feature (minor version bump)fix– Bug fix (patch version bump)refactor– Code refactoring, no functional changedocs– Documentation onlytest– Adding or updating testschore– Build, CI, dependency updatesmajor/BREAKING CHANGE– Breaking change (major version bump)What Changed
Provider / Workflow / Role Changes
config/providers/)config/roles/)config/workflows/)examples/)Security Considerations
Security notes (if applicable):
Testing
go test ./...)Manual test scenario (if applicable):
Breaking Changes
Migration steps (if applicable):
Documentation
docs/updatedREADME.mdupdatedChecklist
mainfeat:,fix:,major:, etc.)