# Automations ## CancelWorkflowExecution `client.Automations.CancelExecution(ctx, body) (*AutomationCancelExecutionResponse, error)` **post** `/gitpod.v1.WorkflowService/CancelWorkflowExecution` Cancels a running workflow execution. Use this method to: - Stop long-running executions - Cancel failed executions - Manage resource usage ### Examples - Cancel execution: Stops a running workflow execution. ```yaml workflowExecutionId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body AutomationCancelExecutionParams` - `WorkflowExecutionID param.Field[string]` ### Returns - `type AutomationCancelExecutionResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Automations.CancelExecution(context.TODO(), gitpod.AutomationCancelExecutionParams{ WorkflowExecutionID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ``` ## CancelWorkflowExecutionAction `client.Automations.CancelExecutionAction(ctx, body) (*AutomationCancelExecutionActionResponse, error)` **post** `/gitpod.v1.WorkflowService/CancelWorkflowExecutionAction` Cancels a running workflow execution action. Use this method to: - Stop long-running actions - Cancel failed actions - Manage resource usage ### Examples - Cancel execution action: Stops a running workflow execution action. ```yaml workflowExecutionActionId: "a1b2c3d4-5e6f-7890-abcd-ef1234567890" ``` ### Parameters - `body AutomationCancelExecutionActionParams` - `WorkflowExecutionActionID param.Field[string]` ### Returns - `type AutomationCancelExecutionActionResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Automations.CancelExecutionAction(context.TODO(), gitpod.AutomationCancelExecutionActionParams{ WorkflowExecutionActionID: gitpod.F("a1b2c3d4-5e6f-7890-abcd-ef1234567890"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ``` ## CreateWorkflow `client.Automations.New(ctx, body) (*AutomationNewResponse, error)` **post** `/gitpod.v1.WorkflowService/CreateWorkflow` Creates a new workflow with specified configuration. Use this method to: - Set up automated workflows - Configure workflow triggers - Define workflow actions and steps - Set execution limits and constraints ### Parameters - `body AutomationNewParams` - `Action param.Field[WorkflowAction]` WorkflowAction defines the actions to be executed in a workflow. - `Description param.Field[string]` Description must be at most 500 characters: ``` size(this) <= 500 ``` - `Executor param.Field[Subject]` Optional executor for the workflow. If not provided, defaults to the creator. Must be either the caller themselves or a service account. - `Name param.Field[string]` Name must be between 1 and 80 characters: ``` size(this) >= 1 && size(this) <= 80 ``` - `Report param.Field[WorkflowAction]` WorkflowAction defines the actions to be executed in a workflow. - `Triggers param.Field[[]WorkflowTrigger]` Automation must have between 1 and 10 triggers: ``` size(this) >= 1 && size(this) <= 10 ``` - `Context WorkflowTriggerContext` WorkflowTriggerContext defines the context in which a workflow should run. Context determines where and how the workflow executes: - Projects: Execute in specific project environments - Repositories: Execute in environments created from repository URLs - Agent: Execute in agent-managed environments with custom prompts - FromTrigger: Use context derived from the trigger event (PR-specific) Context Usage by Trigger Type: - Manual: Can use any context type - Time: Typically uses Projects or Repositories context - PullRequest: Can use any context, FromTrigger uses PR repository context - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - executed when StartWorkflow RPC is called. No additional configuration needed. - `PullRequest WorkflowTriggerPullRequest` Pull request trigger - executed when specified PR events occur. Only triggers for PRs in repositories matching the trigger context. - `Events []WorkflowTriggerPullRequestEvent` - `const WorkflowTriggerPullRequestEventPullRequestEventUnspecified WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UNSPECIFIED"` - `const WorkflowTriggerPullRequestEventPullRequestEventOpened WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_OPENED"` - `const WorkflowTriggerPullRequestEventPullRequestEventUpdated WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UPDATED"` - `const WorkflowTriggerPullRequestEventPullRequestEventApproved WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_APPROVED"` - `const WorkflowTriggerPullRequestEventPullRequestEventMerged WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_MERGED"` - `const WorkflowTriggerPullRequestEventPullRequestEventClosed WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_CLOSED"` - `const WorkflowTriggerPullRequestEventPullRequestEventReadyForReview WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_READY_FOR_REVIEW"` - `IntegrationID string` integration_id is the optional ID of an integration that acts as the source of webhook events. When set, the trigger will be activated when the webhook receives events. - `WebhookID string` webhook_id is the optional ID of a webhook that this trigger is bound to. When set, the trigger will be activated when the webhook receives events. This allows multiple workflows to share a single webhook endpoint. - `Time WorkflowTriggerTime` Time-based trigger - executed automatically based on cron schedule. Uses standard cron expression format (minute hour day month weekday). - `CronExpression string` Cron expression must be between 1 and 100 characters: ``` size(this) >= 1 && size(this) <= 100 ``` ### Returns - `type AutomationNewResponse struct{…}` - `Workflow Workflow` Workflow represents a workflow configuration. - `ID string` - `Metadata WorkflowMetadata` WorkflowMetadata contains workflow metadata. - `CreatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` - `Executor Subject` - `Name string` - `UpdatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Spec WorkflowSpec` - `Action WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Limits WorkflowActionLimits` Limits defines execution limits for workflow actions. Concurrent actions limit cannot exceed total actions limit: ``` this.max_parallel <= this.max_total ``` - `MaxParallel int64` Maximum parallel actions must be between 1 and 25: ``` this >= 1 && this <= 25 ``` - `MaxTotal int64` Maximum total actions must be between 1 and 100: ``` this >= 1 && this <= 100 ``` - `PerExecution WorkflowActionLimitsPerExecution` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Steps []WorkflowStep` Automation must have between 1 and 50 steps: ``` size(this) >= 1 && size(this) <= 50 ``` - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `Report WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Triggers []WorkflowTrigger` - `Context WorkflowTriggerContext` WorkflowTriggerContext defines the context in which a workflow should run. Context determines where and how the workflow executes: - Projects: Execute in specific project environments - Repositories: Execute in environments created from repository URLs - Agent: Execute in agent-managed environments with custom prompts - FromTrigger: Use context derived from the trigger event (PR-specific) Context Usage by Trigger Type: - Manual: Can use any context type - Time: Typically uses Projects or Repositories context - PullRequest: Can use any context, FromTrigger uses PR repository context - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - executed when StartWorkflow RPC is called. No additional configuration needed. - `PullRequest WorkflowTriggerPullRequest` Pull request trigger - executed when specified PR events occur. Only triggers for PRs in repositories matching the trigger context. - `Events []WorkflowTriggerPullRequestEvent` - `const WorkflowTriggerPullRequestEventPullRequestEventUnspecified WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UNSPECIFIED"` - `const WorkflowTriggerPullRequestEventPullRequestEventOpened WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_OPENED"` - `const WorkflowTriggerPullRequestEventPullRequestEventUpdated WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UPDATED"` - `const WorkflowTriggerPullRequestEventPullRequestEventApproved WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_APPROVED"` - `const WorkflowTriggerPullRequestEventPullRequestEventMerged WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_MERGED"` - `const WorkflowTriggerPullRequestEventPullRequestEventClosed WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_CLOSED"` - `const WorkflowTriggerPullRequestEventPullRequestEventReadyForReview WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_READY_FOR_REVIEW"` - `IntegrationID string` integration_id is the optional ID of an integration that acts as the source of webhook events. When set, the trigger will be activated when the webhook receives events. - `WebhookID string` webhook_id is the optional ID of a webhook that this trigger is bound to. When set, the trigger will be activated when the webhook receives events. This allows multiple workflows to share a single webhook endpoint. - `Time WorkflowTriggerTime` Time-based trigger - executed automatically based on cron schedule. Uses standard cron expression format (minute hour day month weekday). - `CronExpression string` Cron expression must be between 1 and 100 characters: ``` size(this) >= 1 && size(this) <= 100 ``` - `WebhookURL string` Webhook URL for triggering this workflow via HTTP POST Format: {base_url}/workflows/{workflow_id}/webhooks ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) automation, err := client.Automations.New(context.TODO(), gitpod.AutomationNewParams{ Action: gitpod.F(gitpod.WorkflowActionParam{ Limits: gitpod.F(gitpod.WorkflowActionLimitsParam{ }), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", automation.Workflow) } ``` #### Response ```json { "workflow": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "description": "description", "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "updatedAt": "2019-12-27T18:11:19.117Z" }, "spec": { "action": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "deleting": true, "disabled": true, "report": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "triggers": [ { "context": { "agent": { "prompt": "prompt" }, "fromTrigger": {}, "projects": { "projectIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }, "repositories": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "repoSelector": { "repoSearchString": "x", "scmHost": "x" }, "repositoryUrls": { "repoUrls": [ "x" ] } } }, "manual": {}, "pullRequest": { "events": [ "PULL_REQUEST_EVENT_UNSPECIFIED" ], "integrationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "webhookId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "time": { "cronExpression": "cronExpression" } } ] }, "webhookUrl": "webhookUrl" } } ``` ## DeleteWorkflow `client.Automations.Delete(ctx, body) (*AutomationDeleteResponse, error)` **post** `/gitpod.v1.WorkflowService/DeleteWorkflow` Deletes a workflow permanently. Use this method to: - Remove unused workflows - Clean up test workflows - Delete obsolete configurations ### Examples - Delete workflow: Permanently removes a workflow. ```yaml workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body AutomationDeleteParams` - `Force param.Field[bool]` force indicates whether to immediately delete the workflow and all related resources. When true, performs cascading deletion of: - All workflow executions - All workflow execution actions - All environments created by workflow actions - All agent executions created by workflow actions - The workflow itself When false (default), marks workflow executions for deletion and relies on background reconciliation to clean up resources. - `WorkflowID param.Field[string]` ### Returns - `type AutomationDeleteResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) automation, err := client.Automations.Delete(context.TODO(), gitpod.AutomationDeleteParams{ WorkflowID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", automation) } ``` #### Response ```json {} ``` ## ListWorkflows `client.Automations.List(ctx, params) (*WorkflowsPage[Workflow], error)` **post** `/gitpod.v1.WorkflowService/ListWorkflows` ListWorkflows ### Parameters - `params AutomationListParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[AutomationListParamsFilter]` Body param - `CreatorIDs []string` creator_ids filters workflows by creator user IDs - `HasFailedExecutionSince Time` has_failed_execution_since filters workflows that have at least one failed execution with create_time >= the specified timestamp. A failed execution is one that is COMPLETED with failed_action_count > 0, or STOPPED with failed_action_count > 0 or a non-empty failure_message. This filter is mutually exclusive with status_phases. - `Search string` search performs case-insensitive search across workflow name, description, and ID - `StatusPhases []AutomationListParamsFilterStatusPhase` status_phases filters workflows by the phase of their latest execution. Only workflows whose most recent execution matches one of the specified phases are returned. - `const AutomationListParamsFilterStatusPhaseWorkflowExecutionPhaseUnspecified AutomationListParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"` - `const AutomationListParamsFilterStatusPhaseWorkflowExecutionPhasePending AutomationListParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_PENDING"` - `const AutomationListParamsFilterStatusPhaseWorkflowExecutionPhaseRunning AutomationListParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_RUNNING"` - `const AutomationListParamsFilterStatusPhaseWorkflowExecutionPhaseStopping AutomationListParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPING"` - `const AutomationListParamsFilterStatusPhaseWorkflowExecutionPhaseStopped AutomationListParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPED"` - `const AutomationListParamsFilterStatusPhaseWorkflowExecutionPhaseDeleting AutomationListParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETING"` - `const AutomationListParamsFilterStatusPhaseWorkflowExecutionPhaseDeleted AutomationListParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETED"` - `const AutomationListParamsFilterStatusPhaseWorkflowExecutionPhaseCompleted AutomationListParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_COMPLETED"` - `WorkflowIDs []string` - `Pagination param.Field[AutomationListParamsPagination]` Body param - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. - `Sort param.Field[AutomationListParamsSort]` Body param: sort specifies the order of results. When unspecified, results are sorted alphabetically by name ascending. - `Field AutomationListParamsSortField` - `const AutomationListParamsSortFieldSortFieldUnspecified AutomationListParamsSortField = "SORT_FIELD_UNSPECIFIED"` - `const AutomationListParamsSortFieldSortFieldName AutomationListParamsSortField = "SORT_FIELD_NAME"` - `const AutomationListParamsSortFieldSortFieldRecentlyCompleted AutomationListParamsSortField = "SORT_FIELD_RECENTLY_COMPLETED"` - `Order SortOrder` - `const SortOrderUnspecified SortOrder = "SORT_ORDER_UNSPECIFIED"` - `const SortOrderAsc SortOrder = "SORT_ORDER_ASC"` - `const SortOrderDesc SortOrder = "SORT_ORDER_DESC"` ### Returns - `type Workflow struct{…}` Workflow represents a workflow configuration. - `ID string` - `Metadata WorkflowMetadata` WorkflowMetadata contains workflow metadata. - `CreatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` - `Executor Subject` - `Name string` - `UpdatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Spec WorkflowSpec` - `Action WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Limits WorkflowActionLimits` Limits defines execution limits for workflow actions. Concurrent actions limit cannot exceed total actions limit: ``` this.max_parallel <= this.max_total ``` - `MaxParallel int64` Maximum parallel actions must be between 1 and 25: ``` this >= 1 && this <= 25 ``` - `MaxTotal int64` Maximum total actions must be between 1 and 100: ``` this >= 1 && this <= 100 ``` - `PerExecution WorkflowActionLimitsPerExecution` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Steps []WorkflowStep` Automation must have between 1 and 50 steps: ``` size(this) >= 1 && size(this) <= 50 ``` - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `Report WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Triggers []WorkflowTrigger` - `Context WorkflowTriggerContext` WorkflowTriggerContext defines the context in which a workflow should run. Context determines where and how the workflow executes: - Projects: Execute in specific project environments - Repositories: Execute in environments created from repository URLs - Agent: Execute in agent-managed environments with custom prompts - FromTrigger: Use context derived from the trigger event (PR-specific) Context Usage by Trigger Type: - Manual: Can use any context type - Time: Typically uses Projects or Repositories context - PullRequest: Can use any context, FromTrigger uses PR repository context - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - executed when StartWorkflow RPC is called. No additional configuration needed. - `PullRequest WorkflowTriggerPullRequest` Pull request trigger - executed when specified PR events occur. Only triggers for PRs in repositories matching the trigger context. - `Events []WorkflowTriggerPullRequestEvent` - `const WorkflowTriggerPullRequestEventPullRequestEventUnspecified WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UNSPECIFIED"` - `const WorkflowTriggerPullRequestEventPullRequestEventOpened WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_OPENED"` - `const WorkflowTriggerPullRequestEventPullRequestEventUpdated WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UPDATED"` - `const WorkflowTriggerPullRequestEventPullRequestEventApproved WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_APPROVED"` - `const WorkflowTriggerPullRequestEventPullRequestEventMerged WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_MERGED"` - `const WorkflowTriggerPullRequestEventPullRequestEventClosed WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_CLOSED"` - `const WorkflowTriggerPullRequestEventPullRequestEventReadyForReview WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_READY_FOR_REVIEW"` - `IntegrationID string` integration_id is the optional ID of an integration that acts as the source of webhook events. When set, the trigger will be activated when the webhook receives events. - `WebhookID string` webhook_id is the optional ID of a webhook that this trigger is bound to. When set, the trigger will be activated when the webhook receives events. This allows multiple workflows to share a single webhook endpoint. - `Time WorkflowTriggerTime` Time-based trigger - executed automatically based on cron schedule. Uses standard cron expression format (minute hour day month weekday). - `CronExpression string` Cron expression must be between 1 and 100 characters: ``` size(this) >= 1 && size(this) <= 100 ``` - `WebhookURL string` Webhook URL for triggering this workflow via HTTP POST Format: {base_url}/workflows/{workflow_id}/webhooks ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Automations.List(context.TODO(), gitpod.AutomationListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "count": { "relation": "COUNT_RESPONSE_RELATION_UNSPECIFIED", "value": 0 }, "pagination": { "nextToken": "nextToken" }, "workflows": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "description": "description", "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "updatedAt": "2019-12-27T18:11:19.117Z" }, "spec": { "action": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "deleting": true, "disabled": true, "report": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "triggers": [ { "context": { "agent": { "prompt": "prompt" }, "fromTrigger": {}, "projects": { "projectIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }, "repositories": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "repoSelector": { "repoSearchString": "x", "scmHost": "x" }, "repositoryUrls": { "repoUrls": [ "x" ] } } }, "manual": {}, "pullRequest": { "events": [ "PULL_REQUEST_EVENT_UNSPECIFIED" ], "integrationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "webhookId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "time": { "cronExpression": "cronExpression" } } ] }, "webhookUrl": "webhookUrl" } ] } ``` ## ListWorkflowExecutionActions `client.Automations.ListExecutionActions(ctx, params) (*WorkflowExecutionActionsPage[WorkflowExecutionAction], error)` **post** `/gitpod.v1.WorkflowService/ListWorkflowExecutionActions` Lists workflow execution actions with optional filtering. Use this method to: - Monitor individual action execution status - Debug action failures - Track resource usage per action ### Examples - List execution actions for workflow execution: Shows all execution actions for a specific workflow execution. ```yaml filter: workflowExecutionIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] pagination: pageSize: 20 ``` ### Parameters - `params AutomationListExecutionActionsParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[AutomationListExecutionActionsParamsFilter]` Body param - `Phases []AutomationListExecutionActionsParamsFilterPhase` - `const AutomationListExecutionActionsParamsFilterPhaseWorkflowExecutionActionPhaseUnspecified AutomationListExecutionActionsParamsFilterPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED"` - `const AutomationListExecutionActionsParamsFilterPhaseWorkflowExecutionActionPhasePending AutomationListExecutionActionsParamsFilterPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_PENDING"` - `const AutomationListExecutionActionsParamsFilterPhaseWorkflowExecutionActionPhaseRunning AutomationListExecutionActionsParamsFilterPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_RUNNING"` - `const AutomationListExecutionActionsParamsFilterPhaseWorkflowExecutionActionPhaseStopping AutomationListExecutionActionsParamsFilterPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPING"` - `const AutomationListExecutionActionsParamsFilterPhaseWorkflowExecutionActionPhaseStopped AutomationListExecutionActionsParamsFilterPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPED"` - `const AutomationListExecutionActionsParamsFilterPhaseWorkflowExecutionActionPhaseDeleting AutomationListExecutionActionsParamsFilterPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DELETING"` - `const AutomationListExecutionActionsParamsFilterPhaseWorkflowExecutionActionPhaseDeleted AutomationListExecutionActionsParamsFilterPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DELETED"` - `const AutomationListExecutionActionsParamsFilterPhaseWorkflowExecutionActionPhaseDone AutomationListExecutionActionsParamsFilterPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DONE"` - `WorkflowExecutionActionIDs []string` - `WorkflowExecutionIDs []string` - `WorkflowIDs []string` - `Pagination param.Field[AutomationListExecutionActionsParamsPagination]` Body param - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `type WorkflowExecutionAction struct{…}` WorkflowExecutionAction represents a workflow execution action instance. - `ID string` - `Metadata WorkflowExecutionActionMetadata` WorkflowExecutionActionMetadata contains workflow execution action metadata. - `ActionName string` Human-readable name for this action based on its context. Examples: "gitpod-io/gitpod-next" for repository context, "My Project" for project context. Will be empty string for actions created before this field was added. - `FinishedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `StartedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `WorkflowExecutionID string` - `WorkflowID string` - `Spec WorkflowExecutionActionSpec` WorkflowExecutionActionSpec contains the specification for this execution action. - `Context AgentCodeContext` Context for the execution action - specifies where and how the action executes. This is resolved from the workflow trigger context and contains the specific project, repository, or agent context for this execution instance. - `ContextURL AgentCodeContextContextURL` - `EnvironmentClassID string` - `URL string` - `EnvironmentID string` - `ProjectID string` - `PullRequest AgentCodeContextPullRequest` Pull request context - optional metadata about the PR being worked on This is populated when the agent execution is triggered by a PR workflow or when explicitly provided through the browser extension - `ID string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository AgentCodeContextPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") - `Limits WorkflowExecutionActionSpecLimits` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Status WorkflowExecutionActionStatus` WorkflowExecutionActionStatus contains the current status of a workflow execution action. - `AgentExecutionID string` - `EnvironmentID string` - `Failures []WorkflowExecutionActionStatusFailure` Structured failures that caused the workflow execution action to fail. Provides detailed error codes, messages, and retry information. - `Code WorkflowExecutionActionStatusFailuresCode` Error code identifying the type of error. - `const WorkflowExecutionActionStatusFailuresCodeWorkflowErrorCodeUnspecified WorkflowExecutionActionStatusFailuresCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusFailuresCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionActionStatusFailuresCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionActionStatusFailuresCodeWorkflowErrorCodeAgentError WorkflowExecutionActionStatusFailuresCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionActionStatusFailuresRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. - `Phase WorkflowExecutionActionStatusPhase` WorkflowExecutionActionPhase defines the phases of workflow execution action. - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseUnspecified WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhasePending WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_PENDING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseRunning WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_RUNNING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseStopping WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseStopped WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPED"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseDeleting WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DELETING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseDeleted WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DELETED"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseDone WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DONE"` - `StepStatuses []WorkflowExecutionActionStatusStepStatus` Step-level progress tracking - `Error WorkflowExecutionActionStatusStepStatusesError` Structured error that caused the step to fail. Provides detailed error code, message, and retry information. - `Code WorkflowExecutionActionStatusStepStatusesErrorCode` Error code identifying the type of error. - `const WorkflowExecutionActionStatusStepStatusesErrorCodeWorkflowErrorCodeUnspecified WorkflowExecutionActionStatusStepStatusesErrorCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusStepStatusesErrorCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionActionStatusStepStatusesErrorCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionActionStatusStepStatusesErrorCodeWorkflowErrorCodeAgentError WorkflowExecutionActionStatusStepStatusesErrorCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionActionStatusStepStatusesErrorRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. - `FinishedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Phase WorkflowExecutionActionStatusStepStatusesPhase` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseUnspecified WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhasePending WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_PENDING"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseRunning WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_RUNNING"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseDone WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_DONE"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseFailed WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_FAILED"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseCancelled WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_CANCELLED"` - `StartedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Step WorkflowStep` The step definition captured at execution time for immutability. This ensures the UI shows the correct step even if the workflow definition changes. - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `StepIndex int64` Index of the step in the workflow action steps array - `Warnings []WorkflowExecutionActionStatusWarning` Structured warnings about the workflow execution action. Provides detailed warning codes and messages. - `Code WorkflowExecutionActionStatusWarningsCode` Error code identifying the type of error. - `const WorkflowExecutionActionStatusWarningsCodeWorkflowErrorCodeUnspecified WorkflowExecutionActionStatusWarningsCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusWarningsCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionActionStatusWarningsCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionActionStatusWarningsCodeWorkflowErrorCodeAgentError WorkflowExecutionActionStatusWarningsCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionActionStatusWarningsRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Automations.ListExecutionActions(context.TODO(), gitpod.AutomationListExecutionActionsParams{ Filter: gitpod.F(gitpod.AutomationListExecutionActionsParamsFilter{ WorkflowExecutionIDs: gitpod.F([]string{"d2c94c27-3b76-4a42-b88c-95a85e392c68"}), }), Pagination: gitpod.F(gitpod.AutomationListExecutionActionsParamsPagination{ PageSize: gitpod.F(int64(20)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "workflowExecutionActions": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "metadata": { "actionName": "actionName", "finishedAt": "2019-12-27T18:11:19.117Z", "startedAt": "2019-12-27T18:11:19.117Z", "workflowExecutionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "workflowId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "spec": { "context": { "contextUrl": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "url": "https://example.com" }, "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "pullRequest": { "id": "id", "author": "author", "draft": true, "fromBranch": "fromBranch", "repository": { "cloneUrl": "cloneUrl", "host": "host", "name": "name", "owner": "owner" }, "state": "STATE_UNSPECIFIED", "title": "title", "toBranch": "toBranch", "url": "url" } }, "desiredPhase": "WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED", "limits": { "maxTime": "+9125115.360s" }, "session": "session" }, "status": { "agentExecutionId": "agentExecutionId", "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "failureMessage": "failureMessage", "failures": [ { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } } ], "phase": "WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED", "session": "session", "stepStatuses": [ { "error": { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } }, "failureMessage": "failureMessage", "finishedAt": "2019-12-27T18:11:19.117Z", "phase": "STEP_PHASE_UNSPECIFIED", "startedAt": "2019-12-27T18:11:19.117Z", "step": { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } }, "stepIndex": 0 } ], "warningMessage": "warningMessage", "warnings": [ { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } } ] } } ] } ``` ## ListWorkflowExecutionOutputs `client.Automations.ListExecutionOutputs(ctx, params) (*OutputsPage[AutomationListExecutionOutputsResponse], error)` **post** `/gitpod.v1.WorkflowService/ListWorkflowExecutionOutputs` Lists outputs produced by workflow execution actions. Use this method to: - Retrieve test results, coverage metrics, or other structured data from executions - Aggregate outputs across multiple workflow executions - Build dashboards or reports from execution data ### Examples - List outputs for a workflow execution: Retrieves all outputs produced by actions in the specified execution. ```yaml filter: workflowExecutionIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"] pagination: pageSize: 50 ``` ### Parameters - `params AutomationListExecutionOutputsParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[AutomationListExecutionOutputsParamsFilter]` Body param - `WorkflowExecutionIDs []string` - `Pagination param.Field[AutomationListExecutionOutputsParamsPagination]` Body param - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. ### Returns - `type AutomationListExecutionOutputsResponse struct{…}` - `ActionID string` - `Values map[string, AutomationListExecutionOutputsResponseValue]` - `BoolValue bool` - `FloatValue float64` - `IntValue string` - `StringValue string` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Automations.ListExecutionOutputs(context.TODO(), gitpod.AutomationListExecutionOutputsParams{ Filter: gitpod.F(gitpod.AutomationListExecutionOutputsParamsFilter{ WorkflowExecutionIDs: gitpod.F([]string{"d2c94c27-3b76-4a42-b88c-95a85e392c68"}), }), Pagination: gitpod.F(gitpod.AutomationListExecutionOutputsParamsPagination{ PageSize: gitpod.F(int64(50)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "outputs": [ { "actionId": "actionId", "values": { "foo": { "boolValue": true, "floatValue": 0, "intValue": "intValue", "stringValue": "stringValue" } } } ], "pagination": { "nextToken": "nextToken" } } ``` ## ListWorkflowExecutions `client.Automations.ListExecutions(ctx, params) (*WorkflowExecutionsPage[WorkflowExecution], error)` **post** `/gitpod.v1.WorkflowService/ListWorkflowExecutions` Lists workflow executions with optional filtering. Use this method to: - Monitor workflow execution history - Track execution status - Debug workflow issues ### Examples - List executions for workflow: Shows all executions for a specific workflow. ```yaml filter: workflowIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"] pagination: pageSize: 20 ``` ### Parameters - `params AutomationListExecutionsParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[AutomationListExecutionsParamsFilter]` Body param - `HasFailedActions bool` - `Search string` search performs case-insensitive search across workflow execution ID and trigger type - `StatusPhases []AutomationListExecutionsParamsFilterStatusPhase` - `const AutomationListExecutionsParamsFilterStatusPhaseWorkflowExecutionPhaseUnspecified AutomationListExecutionsParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"` - `const AutomationListExecutionsParamsFilterStatusPhaseWorkflowExecutionPhasePending AutomationListExecutionsParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_PENDING"` - `const AutomationListExecutionsParamsFilterStatusPhaseWorkflowExecutionPhaseRunning AutomationListExecutionsParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_RUNNING"` - `const AutomationListExecutionsParamsFilterStatusPhaseWorkflowExecutionPhaseStopping AutomationListExecutionsParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPING"` - `const AutomationListExecutionsParamsFilterStatusPhaseWorkflowExecutionPhaseStopped AutomationListExecutionsParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPED"` - `const AutomationListExecutionsParamsFilterStatusPhaseWorkflowExecutionPhaseDeleting AutomationListExecutionsParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETING"` - `const AutomationListExecutionsParamsFilterStatusPhaseWorkflowExecutionPhaseDeleted AutomationListExecutionsParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETED"` - `const AutomationListExecutionsParamsFilterStatusPhaseWorkflowExecutionPhaseCompleted AutomationListExecutionsParamsFilterStatusPhase = "WORKFLOW_EXECUTION_PHASE_COMPLETED"` - `WorkflowExecutionIDs []string` - `WorkflowIDs []string` - `Pagination param.Field[AutomationListExecutionsParamsPagination]` Body param - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. - `Sort param.Field[Sort]` Body param: sort specifies the order of results. When unspecified, results are sorted by operational priority (running first, then failed, then completed, then others). Supported sort fields: startedAt, finishedAt, createdAt. ### Returns - `type WorkflowExecution struct{…}` WorkflowExecution represents a workflow execution instance. - `ID string` - `Metadata WorkflowExecutionMetadata` WorkflowExecutionMetadata contains workflow execution metadata. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Executor Subject` - `FinishedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `StartedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `WorkflowID string` - `Spec WorkflowExecutionSpec` WorkflowExecutionSpec contains the specification used for this execution. - `Action WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Limits WorkflowActionLimits` Limits defines execution limits for workflow actions. Concurrent actions limit cannot exceed total actions limit: ``` this.max_parallel <= this.max_total ``` - `MaxParallel int64` Maximum parallel actions must be between 1 and 25: ``` this >= 1 && this <= 25 ``` - `MaxTotal int64` Maximum total actions must be between 1 and 100: ``` this >= 1 && this <= 100 ``` - `PerExecution WorkflowActionLimitsPerExecution` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Steps []WorkflowStep` Automation must have between 1 and 50 steps: ``` size(this) >= 1 && size(this) <= 50 ``` - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `Report WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Trigger WorkflowExecutionSpecTrigger` WorkflowExecutionTrigger represents a workflow execution trigger instance. - `Context WorkflowTriggerContext` Context from the workflow trigger - copied at execution time for immutability. This allows the reconciler to create actions without fetching the workflow definition. - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - empty message since no additional data needed - `PullRequest WorkflowExecutionSpecTriggerPullRequest` PullRequest represents pull request metadata from source control systems. This message is used across workflow triggers, executions, and agent contexts to maintain consistent PR information throughout the system. - `ID string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository WorkflowExecutionSpecTriggerPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") - `Time WorkflowExecutionSpecTriggerTime` Time trigger - just the timestamp when it was triggered - `TriggeredAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Status WorkflowExecutionStatus` WorkflowExecutionStatus contains the current status of a workflow execution. - `DoneActionCount int64` - `FailedActionCount int64` - `Failures []WorkflowExecutionStatusFailure` Structured failures that caused the workflow execution to fail. Provides detailed error codes, messages, and retry information. - `Code WorkflowExecutionStatusFailuresCode` Error code identifying the type of error. - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeUnspecified WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeAgentError WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionStatusFailuresRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. - `PendingActionCount int64` - `Phase WorkflowExecutionStatusPhase` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseUnspecified WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhasePending WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_PENDING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseRunning WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_RUNNING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseStopping WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseStopped WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseDeleting WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseDeleted WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseCompleted WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_COMPLETED"` - `RunningActionCount int64` - `StoppedActionCount int64` - `Warnings []WorkflowExecutionStatusWarning` Structured warnings about the workflow execution. Provides detailed warning codes and messages. - `Code WorkflowExecutionStatusWarningsCode` Error code identifying the type of error. - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeUnspecified WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeAgentError WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionStatusWarningsRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Automations.ListExecutions(context.TODO(), gitpod.AutomationListExecutionsParams{ Filter: gitpod.F(gitpod.AutomationListExecutionsParamsFilter{ WorkflowIDs: gitpod.F([]string{"b0e12f6c-4c67-429d-a4a6-d9838b5da047"}), }), Pagination: gitpod.F(gitpod.AutomationListExecutionsParamsPagination{ PageSize: gitpod.F(int64(20)), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "workflowExecutions": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "metadata": { "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "finishedAt": "2019-12-27T18:11:19.117Z", "startedAt": "2019-12-27T18:11:19.117Z", "workflowId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "spec": { "action": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "desiredPhase": "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED", "report": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "session": "session", "trigger": { "context": { "agent": { "prompt": "prompt" }, "fromTrigger": {}, "projects": { "projectIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }, "repositories": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "repoSelector": { "repoSearchString": "x", "scmHost": "x" }, "repositoryUrls": { "repoUrls": [ "x" ] } } }, "manual": {}, "pullRequest": { "id": "id", "author": "author", "draft": true, "fromBranch": "fromBranch", "repository": { "cloneUrl": "cloneUrl", "host": "host", "name": "name", "owner": "owner" }, "state": "STATE_UNSPECIFIED", "title": "title", "toBranch": "toBranch", "url": "url" }, "time": { "triggeredAt": "2019-12-27T18:11:19.117Z" } } }, "status": { "doneActionCount": 0, "failedActionCount": 0, "failureMessage": "failureMessage", "failures": [ { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } } ], "pendingActionCount": 0, "phase": "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED", "runningActionCount": 0, "session": "session", "stoppedActionCount": 0, "warningMessage": "warningMessage", "warnings": [ { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } } ] } } ] } ``` ## GetWorkflow `client.Automations.Get(ctx, body) (*AutomationGetResponse, error)` **post** `/gitpod.v1.WorkflowService/GetWorkflow` Gets details about a specific workflow. Use this method to: - View workflow configuration - Check workflow status - Get workflow metadata ### Examples - Get workflow details: Retrieves information about a specific workflow. ```yaml workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body AutomationGetParams` - `WorkflowID param.Field[string]` ### Returns - `type AutomationGetResponse struct{…}` - `Workflow Workflow` Workflow represents a workflow configuration. - `ID string` - `Metadata WorkflowMetadata` WorkflowMetadata contains workflow metadata. - `CreatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` - `Executor Subject` - `Name string` - `UpdatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Spec WorkflowSpec` - `Action WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Limits WorkflowActionLimits` Limits defines execution limits for workflow actions. Concurrent actions limit cannot exceed total actions limit: ``` this.max_parallel <= this.max_total ``` - `MaxParallel int64` Maximum parallel actions must be between 1 and 25: ``` this >= 1 && this <= 25 ``` - `MaxTotal int64` Maximum total actions must be between 1 and 100: ``` this >= 1 && this <= 100 ``` - `PerExecution WorkflowActionLimitsPerExecution` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Steps []WorkflowStep` Automation must have between 1 and 50 steps: ``` size(this) >= 1 && size(this) <= 50 ``` - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `Report WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Triggers []WorkflowTrigger` - `Context WorkflowTriggerContext` WorkflowTriggerContext defines the context in which a workflow should run. Context determines where and how the workflow executes: - Projects: Execute in specific project environments - Repositories: Execute in environments created from repository URLs - Agent: Execute in agent-managed environments with custom prompts - FromTrigger: Use context derived from the trigger event (PR-specific) Context Usage by Trigger Type: - Manual: Can use any context type - Time: Typically uses Projects or Repositories context - PullRequest: Can use any context, FromTrigger uses PR repository context - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - executed when StartWorkflow RPC is called. No additional configuration needed. - `PullRequest WorkflowTriggerPullRequest` Pull request trigger - executed when specified PR events occur. Only triggers for PRs in repositories matching the trigger context. - `Events []WorkflowTriggerPullRequestEvent` - `const WorkflowTriggerPullRequestEventPullRequestEventUnspecified WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UNSPECIFIED"` - `const WorkflowTriggerPullRequestEventPullRequestEventOpened WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_OPENED"` - `const WorkflowTriggerPullRequestEventPullRequestEventUpdated WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UPDATED"` - `const WorkflowTriggerPullRequestEventPullRequestEventApproved WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_APPROVED"` - `const WorkflowTriggerPullRequestEventPullRequestEventMerged WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_MERGED"` - `const WorkflowTriggerPullRequestEventPullRequestEventClosed WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_CLOSED"` - `const WorkflowTriggerPullRequestEventPullRequestEventReadyForReview WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_READY_FOR_REVIEW"` - `IntegrationID string` integration_id is the optional ID of an integration that acts as the source of webhook events. When set, the trigger will be activated when the webhook receives events. - `WebhookID string` webhook_id is the optional ID of a webhook that this trigger is bound to. When set, the trigger will be activated when the webhook receives events. This allows multiple workflows to share a single webhook endpoint. - `Time WorkflowTriggerTime` Time-based trigger - executed automatically based on cron schedule. Uses standard cron expression format (minute hour day month weekday). - `CronExpression string` Cron expression must be between 1 and 100 characters: ``` size(this) >= 1 && size(this) <= 100 ``` - `WebhookURL string` Webhook URL for triggering this workflow via HTTP POST Format: {base_url}/workflows/{workflow_id}/webhooks ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) automation, err := client.Automations.Get(context.TODO(), gitpod.AutomationGetParams{ WorkflowID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", automation.Workflow) } ``` #### Response ```json { "workflow": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "description": "description", "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "updatedAt": "2019-12-27T18:11:19.117Z" }, "spec": { "action": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "deleting": true, "disabled": true, "report": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "triggers": [ { "context": { "agent": { "prompt": "prompt" }, "fromTrigger": {}, "projects": { "projectIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }, "repositories": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "repoSelector": { "repoSearchString": "x", "scmHost": "x" }, "repositoryUrls": { "repoUrls": [ "x" ] } } }, "manual": {}, "pullRequest": { "events": [ "PULL_REQUEST_EVENT_UNSPECIFIED" ], "integrationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "webhookId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "time": { "cronExpression": "cronExpression" } } ] }, "webhookUrl": "webhookUrl" } } ``` ## GetWorkflowExecution `client.Automations.GetExecution(ctx, body) (*AutomationGetExecutionResponse, error)` **post** `/gitpod.v1.WorkflowService/GetWorkflowExecution` Gets details about a specific workflow execution. Use this method to: - Check execution status - View execution results - Monitor execution progress ### Examples - Get execution details: Retrieves information about a specific execution. ```yaml workflowExecutionId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body AutomationGetExecutionParams` - `WorkflowExecutionID param.Field[string]` ### Returns - `type AutomationGetExecutionResponse struct{…}` - `WorkflowExecution WorkflowExecution` WorkflowExecution represents a workflow execution instance. - `ID string` - `Metadata WorkflowExecutionMetadata` WorkflowExecutionMetadata contains workflow execution metadata. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Executor Subject` - `FinishedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `StartedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `WorkflowID string` - `Spec WorkflowExecutionSpec` WorkflowExecutionSpec contains the specification used for this execution. - `Action WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Limits WorkflowActionLimits` Limits defines execution limits for workflow actions. Concurrent actions limit cannot exceed total actions limit: ``` this.max_parallel <= this.max_total ``` - `MaxParallel int64` Maximum parallel actions must be between 1 and 25: ``` this >= 1 && this <= 25 ``` - `MaxTotal int64` Maximum total actions must be between 1 and 100: ``` this >= 1 && this <= 100 ``` - `PerExecution WorkflowActionLimitsPerExecution` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Steps []WorkflowStep` Automation must have between 1 and 50 steps: ``` size(this) >= 1 && size(this) <= 50 ``` - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `Report WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Trigger WorkflowExecutionSpecTrigger` WorkflowExecutionTrigger represents a workflow execution trigger instance. - `Context WorkflowTriggerContext` Context from the workflow trigger - copied at execution time for immutability. This allows the reconciler to create actions without fetching the workflow definition. - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - empty message since no additional data needed - `PullRequest WorkflowExecutionSpecTriggerPullRequest` PullRequest represents pull request metadata from source control systems. This message is used across workflow triggers, executions, and agent contexts to maintain consistent PR information throughout the system. - `ID string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository WorkflowExecutionSpecTriggerPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") - `Time WorkflowExecutionSpecTriggerTime` Time trigger - just the timestamp when it was triggered - `TriggeredAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Status WorkflowExecutionStatus` WorkflowExecutionStatus contains the current status of a workflow execution. - `DoneActionCount int64` - `FailedActionCount int64` - `Failures []WorkflowExecutionStatusFailure` Structured failures that caused the workflow execution to fail. Provides detailed error codes, messages, and retry information. - `Code WorkflowExecutionStatusFailuresCode` Error code identifying the type of error. - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeUnspecified WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeAgentError WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionStatusFailuresRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. - `PendingActionCount int64` - `Phase WorkflowExecutionStatusPhase` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseUnspecified WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhasePending WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_PENDING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseRunning WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_RUNNING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseStopping WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseStopped WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseDeleting WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseDeleted WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseCompleted WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_COMPLETED"` - `RunningActionCount int64` - `StoppedActionCount int64` - `Warnings []WorkflowExecutionStatusWarning` Structured warnings about the workflow execution. Provides detailed warning codes and messages. - `Code WorkflowExecutionStatusWarningsCode` Error code identifying the type of error. - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeUnspecified WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeAgentError WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionStatusWarningsRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Automations.GetExecution(context.TODO(), gitpod.AutomationGetExecutionParams{ WorkflowExecutionID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.WorkflowExecution) } ``` #### Response ```json { "workflowExecution": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "metadata": { "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "finishedAt": "2019-12-27T18:11:19.117Z", "startedAt": "2019-12-27T18:11:19.117Z", "workflowId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "spec": { "action": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "desiredPhase": "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED", "report": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "session": "session", "trigger": { "context": { "agent": { "prompt": "prompt" }, "fromTrigger": {}, "projects": { "projectIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }, "repositories": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "repoSelector": { "repoSearchString": "x", "scmHost": "x" }, "repositoryUrls": { "repoUrls": [ "x" ] } } }, "manual": {}, "pullRequest": { "id": "id", "author": "author", "draft": true, "fromBranch": "fromBranch", "repository": { "cloneUrl": "cloneUrl", "host": "host", "name": "name", "owner": "owner" }, "state": "STATE_UNSPECIFIED", "title": "title", "toBranch": "toBranch", "url": "url" }, "time": { "triggeredAt": "2019-12-27T18:11:19.117Z" } } }, "status": { "doneActionCount": 0, "failedActionCount": 0, "failureMessage": "failureMessage", "failures": [ { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } } ], "pendingActionCount": 0, "phase": "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED", "runningActionCount": 0, "session": "session", "stoppedActionCount": 0, "warningMessage": "warningMessage", "warnings": [ { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } } ] } } } ``` ## GetWorkflowExecutionAction `client.Automations.GetExecutionAction(ctx, body) (*AutomationGetExecutionActionResponse, error)` **post** `/gitpod.v1.WorkflowService/GetWorkflowExecutionAction` Gets details about a specific workflow execution action. Use this method to: - Check execution action status - View execution action results - Monitor execution action progress ### Examples - Get execution action details: Retrieves information about a specific execution action. ```yaml workflowExecutionActionId: "a1b2c3d4-5e6f-7890-abcd-ef1234567890" ``` ### Parameters - `body AutomationGetExecutionActionParams` - `WorkflowExecutionActionID param.Field[string]` ### Returns - `type AutomationGetExecutionActionResponse struct{…}` - `WorkflowExecutionAction WorkflowExecutionAction` WorkflowExecutionAction represents a workflow execution action instance. - `ID string` - `Metadata WorkflowExecutionActionMetadata` WorkflowExecutionActionMetadata contains workflow execution action metadata. - `ActionName string` Human-readable name for this action based on its context. Examples: "gitpod-io/gitpod-next" for repository context, "My Project" for project context. Will be empty string for actions created before this field was added. - `FinishedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `StartedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `WorkflowExecutionID string` - `WorkflowID string` - `Spec WorkflowExecutionActionSpec` WorkflowExecutionActionSpec contains the specification for this execution action. - `Context AgentCodeContext` Context for the execution action - specifies where and how the action executes. This is resolved from the workflow trigger context and contains the specific project, repository, or agent context for this execution instance. - `ContextURL AgentCodeContextContextURL` - `EnvironmentClassID string` - `URL string` - `EnvironmentID string` - `ProjectID string` - `PullRequest AgentCodeContextPullRequest` Pull request context - optional metadata about the PR being worked on This is populated when the agent execution is triggered by a PR workflow or when explicitly provided through the browser extension - `ID string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository AgentCodeContextPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") - `Limits WorkflowExecutionActionSpecLimits` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Status WorkflowExecutionActionStatus` WorkflowExecutionActionStatus contains the current status of a workflow execution action. - `AgentExecutionID string` - `EnvironmentID string` - `Failures []WorkflowExecutionActionStatusFailure` Structured failures that caused the workflow execution action to fail. Provides detailed error codes, messages, and retry information. - `Code WorkflowExecutionActionStatusFailuresCode` Error code identifying the type of error. - `const WorkflowExecutionActionStatusFailuresCodeWorkflowErrorCodeUnspecified WorkflowExecutionActionStatusFailuresCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusFailuresCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionActionStatusFailuresCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionActionStatusFailuresCodeWorkflowErrorCodeAgentError WorkflowExecutionActionStatusFailuresCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionActionStatusFailuresRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. - `Phase WorkflowExecutionActionStatusPhase` WorkflowExecutionActionPhase defines the phases of workflow execution action. - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseUnspecified WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhasePending WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_PENDING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseRunning WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_RUNNING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseStopping WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseStopped WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPED"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseDeleting WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DELETING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseDeleted WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DELETED"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseDone WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DONE"` - `StepStatuses []WorkflowExecutionActionStatusStepStatus` Step-level progress tracking - `Error WorkflowExecutionActionStatusStepStatusesError` Structured error that caused the step to fail. Provides detailed error code, message, and retry information. - `Code WorkflowExecutionActionStatusStepStatusesErrorCode` Error code identifying the type of error. - `const WorkflowExecutionActionStatusStepStatusesErrorCodeWorkflowErrorCodeUnspecified WorkflowExecutionActionStatusStepStatusesErrorCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusStepStatusesErrorCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionActionStatusStepStatusesErrorCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionActionStatusStepStatusesErrorCodeWorkflowErrorCodeAgentError WorkflowExecutionActionStatusStepStatusesErrorCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionActionStatusStepStatusesErrorRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. - `FinishedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Phase WorkflowExecutionActionStatusStepStatusesPhase` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseUnspecified WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhasePending WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_PENDING"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseRunning WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_RUNNING"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseDone WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_DONE"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseFailed WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_FAILED"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseCancelled WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_CANCELLED"` - `StartedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Step WorkflowStep` The step definition captured at execution time for immutability. This ensures the UI shows the correct step even if the workflow definition changes. - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `StepIndex int64` Index of the step in the workflow action steps array - `Warnings []WorkflowExecutionActionStatusWarning` Structured warnings about the workflow execution action. Provides detailed warning codes and messages. - `Code WorkflowExecutionActionStatusWarningsCode` Error code identifying the type of error. - `const WorkflowExecutionActionStatusWarningsCodeWorkflowErrorCodeUnspecified WorkflowExecutionActionStatusWarningsCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusWarningsCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionActionStatusWarningsCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionActionStatusWarningsCodeWorkflowErrorCodeAgentError WorkflowExecutionActionStatusWarningsCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionActionStatusWarningsRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Automations.GetExecutionAction(context.TODO(), gitpod.AutomationGetExecutionActionParams{ WorkflowExecutionActionID: gitpod.F("a1b2c3d4-5e6f-7890-abcd-ef1234567890"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.WorkflowExecutionAction) } ``` #### Response ```json { "workflowExecutionAction": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "metadata": { "actionName": "actionName", "finishedAt": "2019-12-27T18:11:19.117Z", "startedAt": "2019-12-27T18:11:19.117Z", "workflowExecutionId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "workflowId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "spec": { "context": { "contextUrl": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "url": "https://example.com" }, "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "pullRequest": { "id": "id", "author": "author", "draft": true, "fromBranch": "fromBranch", "repository": { "cloneUrl": "cloneUrl", "host": "host", "name": "name", "owner": "owner" }, "state": "STATE_UNSPECIFIED", "title": "title", "toBranch": "toBranch", "url": "url" } }, "desiredPhase": "WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED", "limits": { "maxTime": "+9125115.360s" }, "session": "session" }, "status": { "agentExecutionId": "agentExecutionId", "environmentId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "failureMessage": "failureMessage", "failures": [ { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } } ], "phase": "WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED", "session": "session", "stepStatuses": [ { "error": { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } }, "failureMessage": "failureMessage", "finishedAt": "2019-12-27T18:11:19.117Z", "phase": "STEP_PHASE_UNSPECIFIED", "startedAt": "2019-12-27T18:11:19.117Z", "step": { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } }, "stepIndex": 0 } ], "warningMessage": "warningMessage", "warnings": [ { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } } ] } } } ``` ## StartWorkflow `client.Automations.StartExecution(ctx, body) (*AutomationStartExecutionResponse, error)` **post** `/gitpod.v1.WorkflowService/StartWorkflow` Starts a workflow execution. Use this method to: - Start workflow execution on demand - Test workflow configurations - Run workflows outside of automatic triggers ### Examples - Start workflow: Starts a workflow execution manually. ```yaml workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body AutomationStartExecutionParams` - `ContextOverride param.Field[WorkflowTriggerContext]` Optional context override for the execution. When provided, replaces the workflow's default trigger context. User must have appropriate permissions on the overridden resources. Supports Projects, Repositories, and Agent context types. FromTrigger context type is not supported for manual overrides. - `Parameters param.Field[map[string, string]]` Parameters to substitute into workflow steps using Go template syntax. Use {{ .Parameters.key_name }} in templatable fields (task.command, agent.prompt, pull_request.title/description/branch, trigger context agent.prompt). Keys must match pattern ^[a-zA-Z_][a-zA-Z0-9_]*$ Maximum 10 parameters allowed. Empty map is treated as no parameters provided. - `WorkflowID param.Field[string]` ### Returns - `type AutomationStartExecutionResponse struct{…}` - `WorkflowExecution WorkflowExecution` WorkflowExecution represents a workflow execution instance. - `ID string` - `Metadata WorkflowExecutionMetadata` WorkflowExecutionMetadata contains workflow execution metadata. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Executor Subject` - `FinishedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `StartedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `WorkflowID string` - `Spec WorkflowExecutionSpec` WorkflowExecutionSpec contains the specification used for this execution. - `Action WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Limits WorkflowActionLimits` Limits defines execution limits for workflow actions. Concurrent actions limit cannot exceed total actions limit: ``` this.max_parallel <= this.max_total ``` - `MaxParallel int64` Maximum parallel actions must be between 1 and 25: ``` this >= 1 && this <= 25 ``` - `MaxTotal int64` Maximum total actions must be between 1 and 100: ``` this >= 1 && this <= 100 ``` - `PerExecution WorkflowActionLimitsPerExecution` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Steps []WorkflowStep` Automation must have between 1 and 50 steps: ``` size(this) >= 1 && size(this) <= 50 ``` - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `Report WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Trigger WorkflowExecutionSpecTrigger` WorkflowExecutionTrigger represents a workflow execution trigger instance. - `Context WorkflowTriggerContext` Context from the workflow trigger - copied at execution time for immutability. This allows the reconciler to create actions without fetching the workflow definition. - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - empty message since no additional data needed - `PullRequest WorkflowExecutionSpecTriggerPullRequest` PullRequest represents pull request metadata from source control systems. This message is used across workflow triggers, executions, and agent contexts to maintain consistent PR information throughout the system. - `ID string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository WorkflowExecutionSpecTriggerPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") - `Time WorkflowExecutionSpecTriggerTime` Time trigger - just the timestamp when it was triggered - `TriggeredAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Status WorkflowExecutionStatus` WorkflowExecutionStatus contains the current status of a workflow execution. - `DoneActionCount int64` - `FailedActionCount int64` - `Failures []WorkflowExecutionStatusFailure` Structured failures that caused the workflow execution to fail. Provides detailed error codes, messages, and retry information. - `Code WorkflowExecutionStatusFailuresCode` Error code identifying the type of error. - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeUnspecified WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeAgentError WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionStatusFailuresRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. - `PendingActionCount int64` - `Phase WorkflowExecutionStatusPhase` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseUnspecified WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhasePending WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_PENDING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseRunning WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_RUNNING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseStopping WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseStopped WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseDeleting WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseDeleted WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseCompleted WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_COMPLETED"` - `RunningActionCount int64` - `StoppedActionCount int64` - `Warnings []WorkflowExecutionStatusWarning` Structured warnings about the workflow execution. Provides detailed warning codes and messages. - `Code WorkflowExecutionStatusWarningsCode` Error code identifying the type of error. - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeUnspecified WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeAgentError WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionStatusWarningsRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Automations.StartExecution(context.TODO(), gitpod.AutomationStartExecutionParams{ WorkflowID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.WorkflowExecution) } ``` #### Response ```json { "workflowExecution": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "metadata": { "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "finishedAt": "2019-12-27T18:11:19.117Z", "startedAt": "2019-12-27T18:11:19.117Z", "workflowId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "spec": { "action": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "desiredPhase": "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED", "report": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "session": "session", "trigger": { "context": { "agent": { "prompt": "prompt" }, "fromTrigger": {}, "projects": { "projectIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }, "repositories": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "repoSelector": { "repoSearchString": "x", "scmHost": "x" }, "repositoryUrls": { "repoUrls": [ "x" ] } } }, "manual": {}, "pullRequest": { "id": "id", "author": "author", "draft": true, "fromBranch": "fromBranch", "repository": { "cloneUrl": "cloneUrl", "host": "host", "name": "name", "owner": "owner" }, "state": "STATE_UNSPECIFIED", "title": "title", "toBranch": "toBranch", "url": "url" }, "time": { "triggeredAt": "2019-12-27T18:11:19.117Z" } } }, "status": { "doneActionCount": 0, "failedActionCount": 0, "failureMessage": "failureMessage", "failures": [ { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } } ], "pendingActionCount": 0, "phase": "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED", "runningActionCount": 0, "session": "session", "stoppedActionCount": 0, "warningMessage": "warningMessage", "warnings": [ { "code": "WORKFLOW_ERROR_CODE_UNSPECIFIED", "message": "message", "meta": { "foo": "string" }, "reason": "reason", "retry": { "retriable": true, "retryAfter": "+9125115.360s" } } ] } } } ``` ## UpdateWorkflow `client.Automations.Update(ctx, body) (*AutomationUpdateResponse, error)` **post** `/gitpod.v1.WorkflowService/UpdateWorkflow` Updates a workflow's configuration using full replacement semantics. Update Behavior: - All provided fields completely replace existing values - Optional fields that are not provided remain unchanged - Complex fields (triggers, action) are replaced entirely, not merged - To remove optional fields, explicitly set them to empty/default values Use this method to: - Modify workflow settings - Update triggers and actions - Change execution limits - Update workflow steps ### Examples - Update workflow name: Changes the workflow's display name. ```yaml workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" name: "Updated Workflow Name" ``` - Replace all triggers: Completely replaces the workflow's trigger configuration. ```yaml workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" triggers: - manual: {} context: projects: projectIds: ["new-project-id"] ``` - Update execution limits: Completely replaces the workflow's action configuration. ```yaml workflowId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" action: limits: maxParallel: 10 maxTotal: 100 steps: - task: command: "npm test" ``` ### Parameters - `body AutomationUpdateParams` - `Action param.Field[WorkflowAction]` WorkflowAction defines the actions to be executed in a workflow. - `Description param.Field[string]` Description must be at most 500 characters: ``` size(this) <= 500 ``` - `Disabled param.Field[bool]` When set, enables or disables the workflow. A disabled workflow will not be triggered by any automatic trigger and manual starts are rejected. - `Executor param.Field[Subject]` - `Name param.Field[string]` Name must be between 1 and 80 characters: ``` size(this) >= 1 && size(this) <= 80 ``` - `Report param.Field[WorkflowAction]` WorkflowAction defines the actions to be executed in a workflow. - `Triggers param.Field[[]WorkflowTrigger]` Automation can have at most 10 triggers: ``` size(this) <= 10 ``` - `Context WorkflowTriggerContext` WorkflowTriggerContext defines the context in which a workflow should run. Context determines where and how the workflow executes: - Projects: Execute in specific project environments - Repositories: Execute in environments created from repository URLs - Agent: Execute in agent-managed environments with custom prompts - FromTrigger: Use context derived from the trigger event (PR-specific) Context Usage by Trigger Type: - Manual: Can use any context type - Time: Typically uses Projects or Repositories context - PullRequest: Can use any context, FromTrigger uses PR repository context - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - executed when StartWorkflow RPC is called. No additional configuration needed. - `PullRequest WorkflowTriggerPullRequest` Pull request trigger - executed when specified PR events occur. Only triggers for PRs in repositories matching the trigger context. - `Events []WorkflowTriggerPullRequestEvent` - `const WorkflowTriggerPullRequestEventPullRequestEventUnspecified WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UNSPECIFIED"` - `const WorkflowTriggerPullRequestEventPullRequestEventOpened WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_OPENED"` - `const WorkflowTriggerPullRequestEventPullRequestEventUpdated WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UPDATED"` - `const WorkflowTriggerPullRequestEventPullRequestEventApproved WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_APPROVED"` - `const WorkflowTriggerPullRequestEventPullRequestEventMerged WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_MERGED"` - `const WorkflowTriggerPullRequestEventPullRequestEventClosed WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_CLOSED"` - `const WorkflowTriggerPullRequestEventPullRequestEventReadyForReview WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_READY_FOR_REVIEW"` - `IntegrationID string` integration_id is the optional ID of an integration that acts as the source of webhook events. When set, the trigger will be activated when the webhook receives events. - `WebhookID string` webhook_id is the optional ID of a webhook that this trigger is bound to. When set, the trigger will be activated when the webhook receives events. This allows multiple workflows to share a single webhook endpoint. - `Time WorkflowTriggerTime` Time-based trigger - executed automatically based on cron schedule. Uses standard cron expression format (minute hour day month weekday). - `CronExpression string` Cron expression must be between 1 and 100 characters: ``` size(this) >= 1 && size(this) <= 100 ``` - `WorkflowID param.Field[string]` ### Returns - `type AutomationUpdateResponse struct{…}` - `Workflow Workflow` Workflow represents a workflow configuration. - `ID string` - `Metadata WorkflowMetadata` WorkflowMetadata contains workflow metadata. - `CreatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` - `Executor Subject` - `Name string` - `UpdatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Spec WorkflowSpec` - `Action WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Limits WorkflowActionLimits` Limits defines execution limits for workflow actions. Concurrent actions limit cannot exceed total actions limit: ``` this.max_parallel <= this.max_total ``` - `MaxParallel int64` Maximum parallel actions must be between 1 and 25: ``` this >= 1 && this <= 25 ``` - `MaxTotal int64` Maximum total actions must be between 1 and 100: ``` this >= 1 && this <= 100 ``` - `PerExecution WorkflowActionLimitsPerExecution` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Steps []WorkflowStep` Automation must have between 1 and 50 steps: ``` size(this) >= 1 && size(this) <= 50 ``` - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `Report WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Triggers []WorkflowTrigger` - `Context WorkflowTriggerContext` WorkflowTriggerContext defines the context in which a workflow should run. Context determines where and how the workflow executes: - Projects: Execute in specific project environments - Repositories: Execute in environments created from repository URLs - Agent: Execute in agent-managed environments with custom prompts - FromTrigger: Use context derived from the trigger event (PR-specific) Context Usage by Trigger Type: - Manual: Can use any context type - Time: Typically uses Projects or Repositories context - PullRequest: Can use any context, FromTrigger uses PR repository context - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - executed when StartWorkflow RPC is called. No additional configuration needed. - `PullRequest WorkflowTriggerPullRequest` Pull request trigger - executed when specified PR events occur. Only triggers for PRs in repositories matching the trigger context. - `Events []WorkflowTriggerPullRequestEvent` - `const WorkflowTriggerPullRequestEventPullRequestEventUnspecified WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UNSPECIFIED"` - `const WorkflowTriggerPullRequestEventPullRequestEventOpened WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_OPENED"` - `const WorkflowTriggerPullRequestEventPullRequestEventUpdated WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UPDATED"` - `const WorkflowTriggerPullRequestEventPullRequestEventApproved WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_APPROVED"` - `const WorkflowTriggerPullRequestEventPullRequestEventMerged WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_MERGED"` - `const WorkflowTriggerPullRequestEventPullRequestEventClosed WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_CLOSED"` - `const WorkflowTriggerPullRequestEventPullRequestEventReadyForReview WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_READY_FOR_REVIEW"` - `IntegrationID string` integration_id is the optional ID of an integration that acts as the source of webhook events. When set, the trigger will be activated when the webhook receives events. - `WebhookID string` webhook_id is the optional ID of a webhook that this trigger is bound to. When set, the trigger will be activated when the webhook receives events. This allows multiple workflows to share a single webhook endpoint. - `Time WorkflowTriggerTime` Time-based trigger - executed automatically based on cron schedule. Uses standard cron expression format (minute hour day month weekday). - `CronExpression string` Cron expression must be between 1 and 100 characters: ``` size(this) >= 1 && size(this) <= 100 ``` - `WebhookURL string` Webhook URL for triggering this workflow via HTTP POST Format: {base_url}/workflows/{workflow_id}/webhooks ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) automation, err := client.Automations.Update(context.TODO(), gitpod.AutomationUpdateParams{ Triggers: gitpod.F([]gitpod.WorkflowTriggerParam{gitpod.WorkflowTriggerParam{ Context: gitpod.F(gitpod.WorkflowTriggerContextParam{ Projects: gitpod.F(gitpod.WorkflowTriggerContextProjectsParam{ ProjectIDs: gitpod.F([]string{"new-project-id"}), }), }), Manual: gitpod.F[any](map[string]interface{}{ }), }}), WorkflowID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", automation.Workflow) } ``` #### Response ```json { "workflow": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "metadata": { "createdAt": "2019-12-27T18:11:19.117Z", "creator": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "description": "description", "executor": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "principal": "PRINCIPAL_UNSPECIFIED" }, "name": "x", "updatedAt": "2019-12-27T18:11:19.117Z" }, "spec": { "action": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "deleting": true, "disabled": true, "report": { "limits": { "maxParallel": 0, "maxTotal": 0, "perExecution": { "maxTime": "+9125115.360s" } }, "steps": [ { "agent": { "prompt": "prompt" }, "pullRequest": { "branch": "branch", "description": "description", "draft": true, "title": "title" }, "report": { "outputs": [ { "acceptanceCriteria": "acceptanceCriteria", "boolean": {}, "command": "command", "float": { "max": 0, "min": 0 }, "integer": { "max": 0, "min": 0 }, "key": "key", "prompt": "prompt", "string": { "pattern": "pattern" }, "title": "title" } ] }, "task": { "command": "command" } } ] }, "triggers": [ { "context": { "agent": { "prompt": "prompt" }, "fromTrigger": {}, "projects": { "projectIds": [ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" ] }, "repositories": { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "repoSelector": { "repoSearchString": "x", "scmHost": "x" }, "repositoryUrls": { "repoUrls": [ "x" ] } } }, "manual": {}, "pullRequest": { "events": [ "PULL_REQUEST_EVENT_UNSPECIFIED" ], "integrationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "webhookId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }, "time": { "cronExpression": "cronExpression" } } ] }, "webhookUrl": "webhookUrl" } } ``` ## Domain Types ### Workflow - `type Workflow struct{…}` Workflow represents a workflow configuration. - `ID string` - `Metadata WorkflowMetadata` WorkflowMetadata contains workflow metadata. - `CreatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Description string` - `Executor Subject` - `Name string` - `UpdatedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Spec WorkflowSpec` - `Action WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Limits WorkflowActionLimits` Limits defines execution limits for workflow actions. Concurrent actions limit cannot exceed total actions limit: ``` this.max_parallel <= this.max_total ``` - `MaxParallel int64` Maximum parallel actions must be between 1 and 25: ``` this >= 1 && this <= 25 ``` - `MaxTotal int64` Maximum total actions must be between 1 and 100: ``` this >= 1 && this <= 100 ``` - `PerExecution WorkflowActionLimitsPerExecution` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Steps []WorkflowStep` Automation must have between 1 and 50 steps: ``` size(this) >= 1 && size(this) <= 50 ``` - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `Report WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Triggers []WorkflowTrigger` - `Context WorkflowTriggerContext` WorkflowTriggerContext defines the context in which a workflow should run. Context determines where and how the workflow executes: - Projects: Execute in specific project environments - Repositories: Execute in environments created from repository URLs - Agent: Execute in agent-managed environments with custom prompts - FromTrigger: Use context derived from the trigger event (PR-specific) Context Usage by Trigger Type: - Manual: Can use any context type - Time: Typically uses Projects or Repositories context - PullRequest: Can use any context, FromTrigger uses PR repository context - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - executed when StartWorkflow RPC is called. No additional configuration needed. - `PullRequest WorkflowTriggerPullRequest` Pull request trigger - executed when specified PR events occur. Only triggers for PRs in repositories matching the trigger context. - `Events []WorkflowTriggerPullRequestEvent` - `const WorkflowTriggerPullRequestEventPullRequestEventUnspecified WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UNSPECIFIED"` - `const WorkflowTriggerPullRequestEventPullRequestEventOpened WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_OPENED"` - `const WorkflowTriggerPullRequestEventPullRequestEventUpdated WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UPDATED"` - `const WorkflowTriggerPullRequestEventPullRequestEventApproved WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_APPROVED"` - `const WorkflowTriggerPullRequestEventPullRequestEventMerged WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_MERGED"` - `const WorkflowTriggerPullRequestEventPullRequestEventClosed WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_CLOSED"` - `const WorkflowTriggerPullRequestEventPullRequestEventReadyForReview WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_READY_FOR_REVIEW"` - `IntegrationID string` integration_id is the optional ID of an integration that acts as the source of webhook events. When set, the trigger will be activated when the webhook receives events. - `WebhookID string` webhook_id is the optional ID of a webhook that this trigger is bound to. When set, the trigger will be activated when the webhook receives events. This allows multiple workflows to share a single webhook endpoint. - `Time WorkflowTriggerTime` Time-based trigger - executed automatically based on cron schedule. Uses standard cron expression format (minute hour day month weekday). - `CronExpression string` Cron expression must be between 1 and 100 characters: ``` size(this) >= 1 && size(this) <= 100 ``` - `WebhookURL string` Webhook URL for triggering this workflow via HTTP POST Format: {base_url}/workflows/{workflow_id}/webhooks ### Workflow Action - `type WorkflowAction struct{…}` WorkflowAction defines the actions to be executed in a workflow. - `Limits WorkflowActionLimits` Limits defines execution limits for workflow actions. Concurrent actions limit cannot exceed total actions limit: ``` this.max_parallel <= this.max_total ``` - `MaxParallel int64` Maximum parallel actions must be between 1 and 25: ``` this >= 1 && this <= 25 ``` - `MaxTotal int64` Maximum total actions must be between 1 and 100: ``` this >= 1 && this <= 100 ``` - `PerExecution WorkflowActionLimitsPerExecution` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Steps []WorkflowStep` Automation must have between 1 and 50 steps: ``` size(this) >= 1 && size(this) <= 50 ``` - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` ### Workflow Execution - `type WorkflowExecution struct{…}` WorkflowExecution represents a workflow execution instance. - `ID string` - `Metadata WorkflowExecutionMetadata` WorkflowExecutionMetadata contains workflow execution metadata. - `Creator Subject` - `ID string` id is the UUID of the subject - `Principal Principal` Principal is the principal of the subject - `const PrincipalUnspecified Principal = "PRINCIPAL_UNSPECIFIED"` - `const PrincipalAccount Principal = "PRINCIPAL_ACCOUNT"` - `const PrincipalUser Principal = "PRINCIPAL_USER"` - `const PrincipalRunner Principal = "PRINCIPAL_RUNNER"` - `const PrincipalEnvironment Principal = "PRINCIPAL_ENVIRONMENT"` - `const PrincipalServiceAccount Principal = "PRINCIPAL_SERVICE_ACCOUNT"` - `const PrincipalRunnerManager Principal = "PRINCIPAL_RUNNER_MANAGER"` - `Executor Subject` - `FinishedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `StartedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `WorkflowID string` - `Spec WorkflowExecutionSpec` WorkflowExecutionSpec contains the specification used for this execution. - `Action WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Limits WorkflowActionLimits` Limits defines execution limits for workflow actions. Concurrent actions limit cannot exceed total actions limit: ``` this.max_parallel <= this.max_total ``` - `MaxParallel int64` Maximum parallel actions must be between 1 and 25: ``` this >= 1 && this <= 25 ``` - `MaxTotal int64` Maximum total actions must be between 1 and 100: ``` this >= 1 && this <= 100 ``` - `PerExecution WorkflowActionLimitsPerExecution` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Steps []WorkflowStep` Automation must have between 1 and 50 steps: ``` size(this) >= 1 && size(this) <= 50 ``` - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `Report WorkflowAction` WorkflowAction defines the actions to be executed in a workflow. - `Trigger WorkflowExecutionSpecTrigger` WorkflowExecutionTrigger represents a workflow execution trigger instance. - `Context WorkflowTriggerContext` Context from the workflow trigger - copied at execution time for immutability. This allows the reconciler to create actions without fetching the workflow definition. - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - empty message since no additional data needed - `PullRequest WorkflowExecutionSpecTriggerPullRequest` PullRequest represents pull request metadata from source control systems. This message is used across workflow triggers, executions, and agent contexts to maintain consistent PR information throughout the system. - `ID string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository WorkflowExecutionSpecTriggerPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") - `Time WorkflowExecutionSpecTriggerTime` Time trigger - just the timestamp when it was triggered - `TriggeredAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Status WorkflowExecutionStatus` WorkflowExecutionStatus contains the current status of a workflow execution. - `DoneActionCount int64` - `FailedActionCount int64` - `Failures []WorkflowExecutionStatusFailure` Structured failures that caused the workflow execution to fail. Provides detailed error codes, messages, and retry information. - `Code WorkflowExecutionStatusFailuresCode` Error code identifying the type of error. - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeUnspecified WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionStatusFailuresCodeWorkflowErrorCodeAgentError WorkflowExecutionStatusFailuresCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionStatusFailuresRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. - `PendingActionCount int64` - `Phase WorkflowExecutionStatusPhase` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseUnspecified WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_UNSPECIFIED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhasePending WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_PENDING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseRunning WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_RUNNING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseStopping WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseStopped WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_STOPPED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseDeleting WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETING"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseDeleted WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_DELETED"` - `const WorkflowExecutionStatusPhaseWorkflowExecutionPhaseCompleted WorkflowExecutionStatusPhase = "WORKFLOW_EXECUTION_PHASE_COMPLETED"` - `RunningActionCount int64` - `StoppedActionCount int64` - `Warnings []WorkflowExecutionStatusWarning` Structured warnings about the workflow execution. Provides detailed warning codes and messages. - `Code WorkflowExecutionStatusWarningsCode` Error code identifying the type of error. - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeUnspecified WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionStatusWarningsCodeWorkflowErrorCodeAgentError WorkflowExecutionStatusWarningsCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionStatusWarningsRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. ### Workflow Execution Action - `type WorkflowExecutionAction struct{…}` WorkflowExecutionAction represents a workflow execution action instance. - `ID string` - `Metadata WorkflowExecutionActionMetadata` WorkflowExecutionActionMetadata contains workflow execution action metadata. - `ActionName string` Human-readable name for this action based on its context. Examples: "gitpod-io/gitpod-next" for repository context, "My Project" for project context. Will be empty string for actions created before this field was added. - `FinishedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `StartedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `WorkflowExecutionID string` - `WorkflowID string` - `Spec WorkflowExecutionActionSpec` WorkflowExecutionActionSpec contains the specification for this execution action. - `Context AgentCodeContext` Context for the execution action - specifies where and how the action executes. This is resolved from the workflow trigger context and contains the specific project, repository, or agent context for this execution instance. - `ContextURL AgentCodeContextContextURL` - `EnvironmentClassID string` - `URL string` - `EnvironmentID string` - `ProjectID string` - `PullRequest AgentCodeContextPullRequest` Pull request context - optional metadata about the PR being worked on This is populated when the agent execution is triggered by a PR workflow or when explicitly provided through the browser extension - `ID string` Unique identifier from the source system (e.g., "123" for GitHub PR #123) - `Author string` Author name as provided by the SCM system - `Draft bool` Whether this is a draft pull request - `FromBranch string` Source branch name (the branch being merged from) - `Repository AgentCodeContextPullRequestRepository` Repository information - `CloneURL string` - `Host string` - `Name string` - `Owner string` - `State State` Current state of the pull request - `const StateUnspecified State = "STATE_UNSPECIFIED"` - `const StateOpen State = "STATE_OPEN"` - `const StateClosed State = "STATE_CLOSED"` - `const StateMerged State = "STATE_MERGED"` - `Title string` Pull request title - `ToBranch string` Target branch name (the branch being merged into) - `URL string` Pull request URL (e.g., "https://github.com/owner/repo/pull/123") - `Limits WorkflowExecutionActionSpecLimits` PerExecution defines limits per execution action. - `MaxTime string` Maximum time allowed for a single execution action. Use standard duration format (e.g., "30m" for 30 minutes, "2h" for 2 hours). - `Status WorkflowExecutionActionStatus` WorkflowExecutionActionStatus contains the current status of a workflow execution action. - `AgentExecutionID string` - `EnvironmentID string` - `Failures []WorkflowExecutionActionStatusFailure` Structured failures that caused the workflow execution action to fail. Provides detailed error codes, messages, and retry information. - `Code WorkflowExecutionActionStatusFailuresCode` Error code identifying the type of error. - `const WorkflowExecutionActionStatusFailuresCodeWorkflowErrorCodeUnspecified WorkflowExecutionActionStatusFailuresCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusFailuresCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionActionStatusFailuresCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionActionStatusFailuresCodeWorkflowErrorCodeAgentError WorkflowExecutionActionStatusFailuresCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionActionStatusFailuresRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. - `Phase WorkflowExecutionActionStatusPhase` WorkflowExecutionActionPhase defines the phases of workflow execution action. - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseUnspecified WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhasePending WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_PENDING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseRunning WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_RUNNING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseStopping WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseStopped WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_STOPPED"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseDeleting WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DELETING"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseDeleted WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DELETED"` - `const WorkflowExecutionActionStatusPhaseWorkflowExecutionActionPhaseDone WorkflowExecutionActionStatusPhase = "WORKFLOW_EXECUTION_ACTION_PHASE_DONE"` - `StepStatuses []WorkflowExecutionActionStatusStepStatus` Step-level progress tracking - `Error WorkflowExecutionActionStatusStepStatusesError` Structured error that caused the step to fail. Provides detailed error code, message, and retry information. - `Code WorkflowExecutionActionStatusStepStatusesErrorCode` Error code identifying the type of error. - `const WorkflowExecutionActionStatusStepStatusesErrorCodeWorkflowErrorCodeUnspecified WorkflowExecutionActionStatusStepStatusesErrorCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusStepStatusesErrorCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionActionStatusStepStatusesErrorCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionActionStatusStepStatusesErrorCodeWorkflowErrorCodeAgentError WorkflowExecutionActionStatusStepStatusesErrorCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionActionStatusStepStatusesErrorRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. - `FinishedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Phase WorkflowExecutionActionStatusStepStatusesPhase` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseUnspecified WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhasePending WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_PENDING"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseRunning WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_RUNNING"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseDone WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_DONE"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseFailed WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_FAILED"` - `const WorkflowExecutionActionStatusStepStatusesPhaseStepPhaseCancelled WorkflowExecutionActionStatusStepStatusesPhase = "STEP_PHASE_CANCELLED"` - `StartedAt Time` A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime\(\)) to obtain a formatter capable of generating timestamps in this format. - `Step WorkflowStep` The step definition captured at execution time for immutability. This ensures the UI shows the correct step even if the workflow definition changes. - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `StepIndex int64` Index of the step in the workflow action steps array - `Warnings []WorkflowExecutionActionStatusWarning` Structured warnings about the workflow execution action. Provides detailed warning codes and messages. - `Code WorkflowExecutionActionStatusWarningsCode` Error code identifying the type of error. - `const WorkflowExecutionActionStatusWarningsCodeWorkflowErrorCodeUnspecified WorkflowExecutionActionStatusWarningsCode = "WORKFLOW_ERROR_CODE_UNSPECIFIED"` - `const WorkflowExecutionActionStatusWarningsCodeWorkflowErrorCodeEnvironmentError WorkflowExecutionActionStatusWarningsCode = "WORKFLOW_ERROR_CODE_ENVIRONMENT_ERROR"` - `const WorkflowExecutionActionStatusWarningsCodeWorkflowErrorCodeAgentError WorkflowExecutionActionStatusWarningsCode = "WORKFLOW_ERROR_CODE_AGENT_ERROR"` - `Message string` Human-readable error message. - `Meta map[string, string]` Additional metadata about the error. Common keys include: - environment_id: ID of the environment - task_id: ID of the task - service_id: ID of the service - workflow_id: ID of the workflow - workflow_execution_id: ID of the workflow execution - `Reason string` Reason explaining why the error occurred. Examples: "not_found", "stopped", "deleted", "creation_failed", "start_failed" - `Retry WorkflowExecutionActionStatusWarningsRetry` Retry configuration. If not set, the error is considered non-retriable. - `Retriable bool` Whether the error is retriable. - `RetryAfter string` Suggested duration to wait before retrying. Only meaningful when retriable is true. ### Workflow Step - `type WorkflowStep struct{…}` WorkflowStep defines a single step in a workflow action. - `Agent WorkflowStepAgent` WorkflowAgentStep represents an agent step that executes with a prompt. - `Prompt string` Prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `PullRequest WorkflowStepPullRequest` WorkflowPullRequestStep represents a pull request creation step. - `Branch string` Branch name must be between 1 and 255 characters: ``` size(this) >= 1 && size(this) <= 255 ``` - `Description string` Description must be at most 20,000 characters: ``` size(this) <= 20000 ``` - `Draft bool` - `Title string` Title must be between 1 and 500 characters: ``` size(this) >= 1 && size(this) <= 500 ``` - `Task WorkflowStepTask` WorkflowTaskStep represents a task step that executes a command. - `Command string` Command must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` ### Workflow Trigger - `type WorkflowTrigger struct{…}` WorkflowTrigger defines when a workflow should be executed. Each trigger type defines a specific condition that will cause the workflow to execute: - Manual: Triggered explicitly by user action via StartWorkflow RPC - Time: Triggered automatically based on cron schedule - PullRequest: Triggered automatically when specified PR events occur Trigger Semantics: - Each trigger instance can create multiple workflow executions - Multiple triggers of the same workflow can fire simultaneously - Each trigger execution is independent and tracked separately - Triggers are evaluated in the context specified by WorkflowTriggerContext - `Context WorkflowTriggerContext` WorkflowTriggerContext defines the context in which a workflow should run. Context determines where and how the workflow executes: - Projects: Execute in specific project environments - Repositories: Execute in environments created from repository URLs - Agent: Execute in agent-managed environments with custom prompts - FromTrigger: Use context derived from the trigger event (PR-specific) Context Usage by Trigger Type: - Manual: Can use any context type - Time: Typically uses Projects or Repositories context - PullRequest: Can use any context, FromTrigger uses PR repository context - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string` - `Manual unknown` Manual trigger - executed when StartWorkflow RPC is called. No additional configuration needed. - `PullRequest WorkflowTriggerPullRequest` Pull request trigger - executed when specified PR events occur. Only triggers for PRs in repositories matching the trigger context. - `Events []WorkflowTriggerPullRequestEvent` - `const WorkflowTriggerPullRequestEventPullRequestEventUnspecified WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UNSPECIFIED"` - `const WorkflowTriggerPullRequestEventPullRequestEventOpened WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_OPENED"` - `const WorkflowTriggerPullRequestEventPullRequestEventUpdated WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_UPDATED"` - `const WorkflowTriggerPullRequestEventPullRequestEventApproved WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_APPROVED"` - `const WorkflowTriggerPullRequestEventPullRequestEventMerged WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_MERGED"` - `const WorkflowTriggerPullRequestEventPullRequestEventClosed WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_CLOSED"` - `const WorkflowTriggerPullRequestEventPullRequestEventReadyForReview WorkflowTriggerPullRequestEvent = "PULL_REQUEST_EVENT_READY_FOR_REVIEW"` - `IntegrationID string` integration_id is the optional ID of an integration that acts as the source of webhook events. When set, the trigger will be activated when the webhook receives events. - `WebhookID string` webhook_id is the optional ID of a webhook that this trigger is bound to. When set, the trigger will be activated when the webhook receives events. This allows multiple workflows to share a single webhook endpoint. - `Time WorkflowTriggerTime` Time-based trigger - executed automatically based on cron schedule. Uses standard cron expression format (minute hour day month weekday). - `CronExpression string` Cron expression must be between 1 and 100 characters: ``` size(this) >= 1 && size(this) <= 100 ``` ### Workflow Trigger Context - `type WorkflowTriggerContext struct{…}` WorkflowTriggerContext defines the context in which a workflow should run. Context determines where and how the workflow executes: - Projects: Execute in specific project environments - Repositories: Execute in environments created from repository URLs - Agent: Execute in agent-managed environments with custom prompts - FromTrigger: Use context derived from the trigger event (PR-specific) Context Usage by Trigger Type: - Manual: Can use any context type - Time: Typically uses Projects or Repositories context - PullRequest: Can use any context, FromTrigger uses PR repository context - `Agent WorkflowTriggerContextAgent` Execute workflow in agent-managed environments. Agent receives the specified prompt and manages execution context. - `Prompt string` Agent prompt must be between 1 and 20,000 characters: ``` size(this) >= 1 && size(this) <= 20000 ``` - `FromTrigger unknown` Use context derived from the trigger event. Currently only supported for PullRequest triggers - uses PR repository context. - `Projects WorkflowTriggerContextProjects` Execute workflow in specific project environments. Creates environments for each specified project. - `ProjectIDs []string` - `Repositories WorkflowTriggerContextRepositories` Execute workflow in environments created from repository URLs. Supports both explicit repository URLs and search patterns. - `EnvironmentClassID string` - `RepoSelector WorkflowTriggerContextRepositoriesRepoSelector` RepositorySelector defines how to select repositories for workflow execution. Combines a search string with an SCM host to identify repositories. - `RepoSearchString string` Search string to match repositories using SCM-specific search patterns. For GitHub: supports GitHub search syntax (e.g., "org:gitpod-io language:go", "user:octocat stars:>100") For GitLab: supports GitLab search syntax See SCM provider documentation for supported search patterns. - `ScmHost string` SCM host where the search should be performed (e.g., "github.com", "gitlab.com") - `RepositoryURLs WorkflowTriggerContextRepositoriesRepositoryURLs` RepositoryURLs contains a list of explicit repository URLs. Creates one action per repository URL. - `RepoURLs []string`