Skip to content

Conversation

@patrickhuie19
Copy link
Contributor

@patrickhuie19 patrickhuie19 commented Jan 2, 2026

Supporting Private Workflow Registry

This change is part of a series of changes to allow the workflow engine to pull workflows from metadata sources other than the WorkflowRegistry.

For broader context, check out https://docs.google.com/document/d/1K5lLtczMe_HyrLTbdLNmb_jxj40lPCmMZW4OBjn7K5U/edit?tab=t.t17fuwqoj0w9#bookmark=id.i3vs01f9lvvr

For the workflow engine specific changes, this diagram is most relevant:
image

Series

[In-review] chainlink-protos: smartcontractkit/chainlink-protos#255
[In-review] chainlink-common: #1749
[In-review] chainlink: smartcontractkit/chainlink#20708

Changes specific to chainlink-common

  • Establish the grpc source client for consumption in the workflow engine
  • Add a server side token parser to use in the grpc workflow metadata source + billing + storage service clients

@github-actions
Copy link

github-actions bot commented Jan 2, 2026

✅ API Diff Results - No breaking changes


📄 View full apidiff report

mchain0
mchain0 previously approved these changes Jan 5, 2026
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 6872c33 Previous: 6c0b1c8 Ratio
BenchmarkKeystore_Sign/nop/in-process 770.9 ns/op 358.4 ns/op 2.15

This comment was automatically generated by workflow using github-action-benchmark.

// start is the pagination offset (0-indexed).
// limit is the maximum number of workflows to return per page.
// Returns workflows, head, hasMore flag indicating if more pages exist, and error.
func (c *Client) ListWorkflowMetadata(ctx context.Context, families []string, start, limit int64) ([]*pb.WorkflowMetadata, *pb.Head, bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@patrickhuie19 Are you sure you want to put this logic in a separate repository? That seems like a heavy price to pay -- isn't the only consumer of this client going to be in core?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks cedric, good q: the benefits I'm seeing: it allows us to easily inject the client into smoke tests within the chainlink repo and eventually the centralized component to deploy in. We follow this pattern for the storage and billing clients.

bolekk
bolekk previously approved these changes Jan 6, 2026
AddWorkflow(ctx context.Context, workflow *WorkflowRegistration) error

// UpdateWorkflow updates the workflow's status configuration
// This is idempotent - calling with the same config multiple times has the same effect
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think this goes without saying, especially when looking at WorkflowStatusConfig struct

return nil, fmt.Errorf("failed to create JWT: %w", err)
}

return metadata.AppendToOutgoingContext(ctx, "authorization", "Bearer "+jwtToken), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL: My gut reaction was that we don't need the "Bearer" prefix in gRPC as it is only specific to HTTP. But a quick Google search said otherwise :)

return nil, fmt.Errorf("failed to create JWT: %w", err)
}

return metadata.AppendToOutgoingContext(ctx, "authorization", "Bearer "+jwtToken), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: put those in consts?

// AuthorizationHeader is the lowercase header key for authorization
AuthorizationHeader = "authorization"
// BearerPrefix is the prefix for Bearer tokens
BearerPrefix = "Bearer "
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: are you sure you want the space included in the constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is defined from the protocol definition, so yes I think it's desirable - what downside are you seeing?

@patrickhuie19 patrickhuie19 added this pull request to the merge queue Jan 6, 2026
Merged via the queue into main with commit e801ad1 Jan 6, 2026
34 of 36 checks passed
@patrickhuie19 patrickhuie19 deleted the feat/private-workflow-registry branch January 6, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants