mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-23 17:18:44 -06:00
* fix: rm method from docs button * feat: close side panel on navigate * feat: migration to fix pk * fix: create index at the end * fix: properly compute pagination response for events * feat: add event count to query * feat: queries * wire up since and until queries * fix: fe * fix: ordering * chore: gen * fix: pesky zero values * fix: rm react-table side pagination * fix: bug * fix: start working on pagination * fix: refactor a bit * fix: pagination * feat: pagination on workflows * fix: callbacks * fix: key * fix: calc * feat: migration attempt 2 * fix: lint * chore: gen * fix: recreate trigger in migration * fix: test improvement * fix: lint * fix: order in schema * fix: rename indexes in partitions too * Feat: FE Burndown, Part V (#1814) * feat: extend eslint config to make a lot of rules much stricter * fix: auto-fix a bunch of linting failures * feat: start fixing a bunch of linting errors * fix: more * fix: run knip to remove a bunch of unused stuff * fix: bunch more errors * fix: bunch more * fix: more * fix: checkout old file * fix: more * fix: couple more callbacks * fix: remaining issues * fix: tsc * fix: copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: copilot pushing stuff that doesn't work, as usual * fix: more ignores --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Feat: Langfuse Integration (#1822) * Fix: Internal blocking calls in admin client (#1818) * fix: admin client blockages * chore: ver * chore: changelog * Revert "fix: rm langfuse for now" This reverts commit493566a307. * Revert "fix: rm langfuse trace pic" This reverts commitfb689f4c50. * fix: pre * chore(deps): bump golang.org/x/crypto from 0.38.0 to 0.39.0 (#1827) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.38.0 to 0.39.0. - [Commits](https://github.com/golang/crypto/compare/v0.38.0...v0.39.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-version: 0.39.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump google.golang.org/grpc from 1.72.2 to 1.73.0 (#1828) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.72.2 to 1.73.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.72.2...v1.73.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.73.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump golang.org/x/text from 0.25.0 to 0.26.0 (#1829) Bumps [golang.org/x/text](https://github.com/golang/text) from 0.25.0 to 0.26.0. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.25.0...v0.26.0) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-version: 0.26.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump golang.org/x/sync from 0.14.0 to 0.15.0 (#1830) Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.14.0 to 0.15.0. - [Commits](https://github.com/golang/sync/compare/v0.14.0...v0.15.0) --- updated-dependencies: - dependency-name: golang.org/x/sync dependency-version: 0.15.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump golang.org/x/time from 0.11.0 to 0.12.0 (#1831) Bumps [golang.org/x/time](https://github.com/golang/time) from 0.11.0 to 0.12.0. - [Commits](https://github.com/golang/time/compare/v0.11.0...v0.12.0) --- updated-dependencies: - dependency-name: golang.org/x/time dependency-version: 0.12.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump hatchet-sdk in /examples/python/quickstart (#1832) Bumps hatchet-sdk from 1.11.0 to 1.11.1. --- updated-dependencies: - dependency-name: hatchet-sdk dependency-version: 1.11.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: update langfuse docs / examples to agree with their recommendations --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Feat: Filter + Events Improvements (#1806) * feat: query for listing filters on a workflow * feat: first pass at new filtering logic * feat: event key wildcards * fix: typo * fix: write wildcard on event ref insert * feat: tests for wildcard * chore: gen * feat: working wildcards * fix: test cruft * fix: tests * fix: tests * fix: tests * feat: improve wildcard handling * fix: missed a payload include spot * feat: extend tests more * feat: extend test more * fix: flakiness * feat: add scope col to events * feat: write scopes into db with events * fix: god I hate zero values * chore: gen, lint, etc. * fix: try wrapping yield in try / finally for robustness * fix: typing * fix: simplify * fix: migration ver * Feat: Tenant getter + corresponding SDK warnings (#1809) * feat: tenant get endpoint * feat: impl for tenant * chore: gen * feat: Python impl * feat: scary warning * chore: lint * fix: try / except * feat: ts client * feat: go * chore: versions * Update sdks/python/hatchet_sdk/hatchet.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update sdks/typescript/src/v1/client/client.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: fmt * fix: description * fix: review * fix: changelog * chore: gen --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Feat: Workflow run status getter on the API (#1808) * feat: api for status getter * feat: api * feat: sdk * chore: gen python * chore: gen ts * fix: simplify api * chore: gen * chore: rm unused python * chore: vers * fix: pr feedback * chore: gen * chore: gen * chore: gen * Feat: Filter Updates (#1840) * feat: api * feat: impl * fix: patch * chore: gen * feat: python * chore: changelog * feat: ts * feat: go * fix: copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Feat: Declaratively create filters on worker start (#1825) * feat: dynamically create filters when workflow is registered * fix: python utc timestamps everywhere * refactor: fix up runs list a bit * refactor: move more methods under shared BaseWorkflow * feat: register default filters * fix: docs * chore: gen, docs * chore: lint * fix: v1 * fix: add filter to proto * feat: implement default filters on put workflow * feat: fix go impl * chore: gen py * feat: wire up Python * fix: rm cruft * fix: ts * fix: bugs * chore: gen, versions * feat: changelog * chore: lock * fix: go * fix: rm cruft * fix: lockfile * feat: add is_declarative flag to filters * feat: extend filter insert queries * feat: bulk upsert filters on workflow version create * fix: wire up declarative stuff * fix: mutexing issue * feat: wire up declarative filters * feat: naming * chore: gen * fix: nullable payloads * fix: check json validity * fix: rm on conflict * fix: query naming + declarative-ness handling * fix: rm payload from error * fix: versions and such * chore: gen * Feat: Filtering + Events Docs Revamp + SDK Tweaks (#1843) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
261 lines
9.2 KiB
Protocol Buffer
261 lines
9.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
option go_package = "github.com/hatchet-dev/hatchet/internal/services/admin/contracts";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
// WorkflowService represents a set of RPCs for managing workflows.
|
|
service WorkflowService {
|
|
rpc PutWorkflow(PutWorkflowRequest) returns (WorkflowVersion);
|
|
rpc ScheduleWorkflow(ScheduleWorkflowRequest) returns (WorkflowVersion);
|
|
rpc TriggerWorkflow(TriggerWorkflowRequest) returns (TriggerWorkflowResponse);
|
|
rpc BulkTriggerWorkflow(BulkTriggerWorkflowRequest) returns (BulkTriggerWorkflowResponse);
|
|
rpc PutRateLimit(PutRateLimitRequest) returns (PutRateLimitResponse);
|
|
}
|
|
|
|
message PutWorkflowRequest {
|
|
CreateWorkflowVersionOpts opts = 1;
|
|
}
|
|
|
|
enum StickyStrategy {
|
|
SOFT = 0;
|
|
HARD = 1;
|
|
}
|
|
|
|
enum WorkflowKind {
|
|
FUNCTION = 0;
|
|
DURABLE = 1;
|
|
DAG = 2;
|
|
}
|
|
|
|
// CreateWorkflowVersionOpts represents options to create a workflow version.
|
|
message CreateWorkflowVersionOpts {
|
|
string name = 1; // (required) the workflow name
|
|
string description = 2; // (optional) the workflow description
|
|
string version = 3; // (required) the workflow version
|
|
repeated string event_triggers = 4; // (optional) event triggers for the workflow
|
|
repeated string cron_triggers = 5; // (optional) cron triggers for the workflow
|
|
repeated google.protobuf.Timestamp scheduled_triggers = 6; // (optional) scheduled triggers for the workflow
|
|
repeated CreateWorkflowJobOpts jobs = 7; // (required) the workflow jobs
|
|
WorkflowConcurrencyOpts concurrency = 8; // (optional) the workflow concurrency options
|
|
optional string schedule_timeout = 9; // (optional) the timeout for the schedule
|
|
optional string cron_input = 10; // (optional) the input for the cron trigger
|
|
optional CreateWorkflowJobOpts on_failure_job = 11; // (optional) the job to run on failure
|
|
optional StickyStrategy sticky = 12; // (optional) the sticky strategy for assigning steps to workers
|
|
optional WorkflowKind kind = 13; // (optional) the kind of workflow
|
|
optional int32 default_priority = 14; // (optional) the priority of the workflow
|
|
}
|
|
|
|
|
|
enum ConcurrencyLimitStrategy {
|
|
CANCEL_IN_PROGRESS = 0;
|
|
DROP_NEWEST = 1; // deprecated
|
|
QUEUE_NEWEST = 2; // deprecated
|
|
GROUP_ROUND_ROBIN = 3;
|
|
CANCEL_NEWEST = 4;
|
|
}
|
|
|
|
message WorkflowConcurrencyOpts {
|
|
optional string action = 1; // (optional) the action id for getting the concurrency group
|
|
optional int32 max_runs = 2; // (optional) the maximum number of concurrent workflow runs, default 1
|
|
optional ConcurrencyLimitStrategy limit_strategy = 3; // (optional) the strategy to use when the concurrency limit is reached, default CANCEL_IN_PROGRESS
|
|
optional string expression = 4; // (optional) the expression to use for concurrency
|
|
}
|
|
|
|
// CreateWorkflowJobOpts represents options to create a workflow job.
|
|
message CreateWorkflowJobOpts {
|
|
string name = 1; // (required) the job name
|
|
string description = 2; // (optional) the job description
|
|
reserved 3; // (deprecated) timeout
|
|
repeated CreateWorkflowStepOpts steps = 4; // (required) the job steps
|
|
}
|
|
|
|
enum WorkerLabelComparator {
|
|
EQUAL = 0;
|
|
NOT_EQUAL = 1;
|
|
GREATER_THAN = 2;
|
|
GREATER_THAN_OR_EQUAL = 3;
|
|
LESS_THAN = 4;
|
|
LESS_THAN_OR_EQUAL = 5;
|
|
}
|
|
|
|
message DesiredWorkerLabels {
|
|
// value of the affinity
|
|
optional string strValue = 1;
|
|
optional int32 intValue = 2;
|
|
|
|
/**
|
|
* (optional) Specifies whether the affinity setting is required.
|
|
* If required, the worker will not accept actions that do not have a truthy affinity setting.
|
|
*
|
|
* Defaults to false.
|
|
*/
|
|
optional bool required = 3;
|
|
|
|
/**
|
|
* (optional) Specifies the comparator for the affinity setting.
|
|
* If not set, the default is EQUAL.
|
|
*/
|
|
optional WorkerLabelComparator comparator = 4;
|
|
|
|
/**
|
|
* (optional) Specifies the weight of the affinity setting.
|
|
* If not set, the default is 100.
|
|
*/
|
|
optional int32 weight = 5;
|
|
}
|
|
|
|
// CreateWorkflowStepOpts represents options to create a workflow step.
|
|
message CreateWorkflowStepOpts {
|
|
string readable_id = 1; // (required) the step name
|
|
string action = 2; // (required) the step action id
|
|
string timeout = 3; // (optional) the step timeout
|
|
string inputs = 4; // (optional) the step inputs, assuming string representation of JSON
|
|
repeated string parents = 5; // (optional) the step parents. if none are passed in, this is a root step
|
|
string user_data = 6; // (optional) the custom step user data, assuming string representation of JSON
|
|
int32 retries = 7; // (optional) the number of retries for the step, default 0
|
|
repeated CreateStepRateLimit rate_limits = 8; // (optional) the rate limits for the step
|
|
map<string, DesiredWorkerLabels> worker_labels = 9; // (optional) the desired worker affinity state for the step
|
|
optional float backoff_factor = 10; // (optional) the retry backoff factor for the step
|
|
optional int32 backoff_max_seconds = 11; // (optional) the maximum backoff time for the step
|
|
}
|
|
|
|
message CreateStepRateLimit {
|
|
string key = 1; // (required) the key for the rate limit
|
|
optional int32 units = 2; // (optional) the number of units this step consumes
|
|
optional string key_expr = 3; // (optional) a CEL expression for determining the rate limit key
|
|
optional string units_expr = 4; // (optional) a CEL expression for determining the number of units consumed
|
|
optional string limit_values_expr = 5; // (optional) a CEL expression for determining the total amount of rate limit units
|
|
optional RateLimitDuration duration = 6; // (optional) the default rate limit window to use for dynamic rate limits
|
|
}
|
|
|
|
// ListWorkflowsRequest is the request for ListWorkflows.
|
|
message ListWorkflowsRequest {}
|
|
|
|
message ScheduleWorkflowRequest {
|
|
string name = 1;
|
|
|
|
repeated google.protobuf.Timestamp schedules = 2;
|
|
|
|
// (optional) the input data for the workflow
|
|
string input = 3;
|
|
|
|
// (optional) the parent workflow run id
|
|
optional string parent_id = 4;
|
|
|
|
// (optional) the parent step run id
|
|
optional string parent_step_run_id = 5;
|
|
|
|
// (optional) the index of the child workflow. if this is set, matches on the index or the
|
|
// child key will be a no-op, even if the schedule has changed.
|
|
optional int32 child_index = 6;
|
|
|
|
// (optional) the key for the child. if this is set, matches on the index or the
|
|
// child key will be a no-op, even if the schedule has changed.
|
|
optional string child_key = 7;
|
|
|
|
// (optional) the additional metadata for the workflow
|
|
optional string additional_metadata = 8;
|
|
|
|
// (optional) the priority of the workflow
|
|
optional int32 priority = 9;
|
|
}
|
|
|
|
// ScheduledWorkflow represents a scheduled workflow.
|
|
message ScheduledWorkflow {
|
|
string id = 1;
|
|
google.protobuf.Timestamp trigger_at = 2;
|
|
}
|
|
|
|
// WorkflowVersion represents the WorkflowVersion model.
|
|
message WorkflowVersion {
|
|
string id = 1;
|
|
google.protobuf.Timestamp created_at = 2;
|
|
google.protobuf.Timestamp updated_at = 3;
|
|
string version = 5;
|
|
int64 order = 6;
|
|
string workflow_id = 7;
|
|
repeated ScheduledWorkflow scheduled_workflows = 8;
|
|
}
|
|
|
|
|
|
// WorkflowTriggerEventRef represents the WorkflowTriggerEventRef model.
|
|
message WorkflowTriggerEventRef {
|
|
string parent_id = 1;
|
|
string event_key = 2;
|
|
}
|
|
|
|
// WorkflowTriggerCronRef represents the WorkflowTriggerCronRef model.
|
|
message WorkflowTriggerCronRef {
|
|
string parent_id = 1;
|
|
string cron = 2;
|
|
}
|
|
|
|
message BulkTriggerWorkflowRequest {
|
|
repeated TriggerWorkflowRequest workflows = 1;
|
|
}
|
|
|
|
message BulkTriggerWorkflowResponse {
|
|
repeated string workflow_run_ids = 1;
|
|
}
|
|
|
|
message TriggerWorkflowRequest {
|
|
string name = 1;
|
|
|
|
// (optional) the input data for the workflow
|
|
string input = 2;
|
|
|
|
// (optional) the parent workflow run id
|
|
optional string parent_id = 3;
|
|
|
|
// (optional) the parent step run id
|
|
optional string parent_step_run_id = 4;
|
|
|
|
// (optional) the index of the child workflow. if this is set, matches on the index or the
|
|
// child key will return an existing workflow run if the parent id, parent step run id, and
|
|
// child index/key match an existing workflow run.
|
|
optional int32 child_index = 5;
|
|
|
|
// (optional) the key for the child. if this is set, matches on the index or the
|
|
// child key will return an existing workflow run if the parent id, parent step run id, and
|
|
// child index/key match an existing workflow run.
|
|
optional string child_key = 6;
|
|
|
|
// (optional) additional metadata for the workflow
|
|
optional string additional_metadata = 7;
|
|
|
|
// (optional) desired worker id for the workflow run,
|
|
// requires the workflow definition to have a sticky strategy
|
|
optional string desired_worker_id = 8;
|
|
|
|
// (optional) override for the priority of the workflow steps, will set all steps to this priority
|
|
optional int32 priority = 9;
|
|
}
|
|
|
|
message TriggerWorkflowResponse {
|
|
string workflow_run_id = 1;
|
|
}
|
|
|
|
enum RateLimitDuration {
|
|
SECOND = 0;
|
|
MINUTE = 1;
|
|
HOUR = 2;
|
|
DAY = 3;
|
|
WEEK = 4;
|
|
MONTH = 5;
|
|
YEAR = 6;
|
|
}
|
|
|
|
message PutRateLimitRequest {
|
|
// (required) the global key for the rate limit
|
|
string key = 1;
|
|
|
|
// (required) the max limit for the rate limit (per unit of time)
|
|
int32 limit = 2;
|
|
|
|
// (required) the duration of time for the rate limit (second|minute|hour)
|
|
RateLimitDuration duration = 3;
|
|
}
|
|
|
|
message PutRateLimitResponse {}
|