AutoFlow
The KAS chart can be configured with AutoFlow support. Currently, the AutoFlow support is limited to what is strictly required for the GitLab internal-use experiment.
This specifically means that only a subset of configuration options are available and only Temporal Cloud via mTLS worker authentication and with data encryption is supported.
Configuration
AutoFlow is configured with the autoflow
value node in the KAS subchart.
A minimal working configuration has the following anatomy:
autoflow:
enabled: true
temporal:
namespace: <unique temporal cloud namespace name>
workerMtls:
secretName: <name of the k8s secret with the mTLS worker certs>
workflowDataEncryption:
codecServer:
authorizedUserEmails: <list of authorized temporal cloud users>
The values within <>
need to be provided by the user of the chart:
<unique temporal cloud namespace name>
: this is the unique name of the Temporal Cloud namespace. The namespace must be created before by the KAS / AutoFlow maintainers. Reach out to#f_autoflow
to get help with that.<name of the k8s secret with the mTLS worker certs>
: this is the name of an already existing Kubernetes secret the KAS deployment will have access to. The secret must be of typetls
and contain thetls.crt
andtls.key
data values. It can be created with a command like this:kubectl create secret tls kas-autoflow-temporal-worker-mtls --cert <path-to-worker-mtls.crt> --key <path-to-worker-mtls.key>
. The mTLS certificate and key can be generated by following this guide. The generated CA certificate must be configured in the Temporal namespace settings<list of authorized temporal cloud users>
: this is a list of email addresses to should have access to the AutoFlow codec server and have already been granted access to the configured namespace.
Manual secret creation (optional)
This section is an addition to the official manual secret creation section in the installation guide.
GitLab KAS AutoFlow Temporal Workflow Data Encryption Secret (experimental)
You can leave it to the chart to auto-generate the secret, or you can create this secret manually (replace <name>
with the name of the release):
openssl rand 32 > secret.bin
kubectl create secret generic <name>-kas-autoflow-temporal-workflow-data-encryption-secret --from-literal=kas_autoflow_temporal_workflow_data_encryption=secret.bin
shred --remove secret.bin
This secret is referenced by the gitlab.kas.autoflow.temporal.workflowDataEncryption.secret
setting.
Verification
The Configuration section must be followed in order to verify (smoke test) the AutoFlow functionality. Follow this step-by-step guide:
After installing the chart make sure the KAS pods are running without logging any errors.
Create a new project in the GitLab instance
Create a AutoFlow script at
.gitlab/autoflow/main.star
with the following contents: (you don’t really need to understand it at this point)# -*- mode: python -*- def handle_event(w, ev): print("Handling event: {}".format(ev["type"])) on_event( type="com.gitlab.events.issue_updated", handler=handle_event, )
Enable feature flags in Rails for AutoFlow using the
gitlab-rails console
in the toolbox pod:Feature.enable(:autoflow_enabled) Feature.enable(:autoflow_issue_events_enabled)
Update an existing issue in that project and verify the KAS logs that it contains logs about handling that event and running the workflow script.
You can also emit events manually via the rails console.
client = Gitlab::Kas::Client.new() # Replace the issue and project IDs to match your setup. client.send_autoflow_event( project: Project.find(1), type: "com.gitlab.events.issue_updated", id: "1", data: {"project": {"id": 1}, "issue": {"iid": 1}} )
If you are interested in running more complex workflows, see this snippet: https://gitlab.com/-/snippets/4800564.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support