Skip to content

Single worker workflow#331

Open
hughneale wants to merge 3 commits into
mainfrom
single-worker-workflow
Open

Single worker workflow#331
hughneale wants to merge 3 commits into
mainfrom
single-worker-workflow

Conversation

@hughneale
Copy link
Copy Markdown
Contributor

@hughneale hughneale commented May 17, 2026

Summary

Briefly describe what this PR does and why. Link to the relevant issue or context.

Closes #


Type of Change

  • feat – New feature (minor version bump)
  • fix – Bug fix (patch version bump)
  • refactor – Code refactoring, no functional change
  • docs – Documentation only
  • test – Adding or updating tests
  • chore – Build, CI, dependency updates
  • major / BREAKING CHANGE – Breaking change (major version bump)

What Changed

A concise list of the changes made. Focus on the what and why, not the how.


Provider / Workflow / Role Changes

Complete this section if you've added or modified providers, workflows, or roles. Delete if not applicable.

Area Change Notes
Provider
Workflow
Role
  • Provider config files updated (config/providers/)
  • Role config files updated (config/roles/)
  • Workflow definitions updated (config/workflows/)
  • Example configs updated (examples/)

Security Considerations

This project handles privileged access. Describe any security implications of this change.

  • No security impact
  • Reviewed for least-privilege impact
  • Access grant / revocation logic reviewed
  • Audit trail is preserved for any new access paths
  • No credentials, tokens, or secrets introduced in code or config

Security notes (if applicable):


Testing

Describe how this was tested. Include commands if helpful.

  • Unit tests pass (go test ./...)
  • Functional tests pass
  • Integration tests pass
  • Manually tested locally — describe scenario below

Manual test scenario (if applicable):

# Describe the steps taken to verify the change works end-to-end

Breaking Changes

If this is a breaking change, describe the impact and any migration steps required.

  • This PR does not introduce breaking changes
  • This PR does introduce breaking changes (describe below)

Migration steps (if applicable):


Documentation

  • No documentation changes needed
  • In-code comments updated
  • docs/ updated
  • README.md updated
  • Config examples updated

Checklist

  • My branch is up to date with main
  • Commit messages follow the conventional commit format (feat:, fix:, major:, etc.)
  • No debug code, hardcoded values, or temporary workarounds left in
  • All new code has appropriate test coverage
  • I have reviewed my own diff before requesting review

Copilot AI review requested due to automatic review settings May 17, 2026 08:02
@hughneale hughneale added the fix Bug fix (patch version bump) label May 17, 2026
@hughneale hughneale added the refactor Code refactoring, no functional change label May 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread internal/models/provider_notifier.go
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix (patch version bump) refactor Code refactoring, no functional change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants