{"id":16682473,"url":"https://github.com/sagikazarmark/temporal-intro-workshop","last_synced_at":"2025-03-21T18:32:46.465Z","repository":{"id":46491065,"uuid":"401343035","full_name":"sagikazarmark/temporal-intro-workshop","owner":"sagikazarmark","description":"Temporal intro workshop","archived":false,"fork":false,"pushed_at":"2023-09-05T01:06:44.000Z","size":4174,"stargazers_count":33,"open_issues_count":5,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T16:11:15.602Z","etag":null,"topics":["go","golang","hacktoberfest","temporal","workshop"],"latest_commit_sha":null,"homepage":"https://sagikazarmark.github.io/temporal-intro-workshop/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sagikazarmark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-30T12:53:32.000Z","updated_at":"2025-02-21T11:14:23.000Z","dependencies_parsed_at":"2024-06-19T01:32:47.885Z","dependency_job_id":"5f676219-5e4d-408b-b427-d6a56e182363","html_url":"https://github.com/sagikazarmark/temporal-intro-workshop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagikazarmark%2Ftemporal-intro-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagikazarmark%2Ftemporal-intro-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagikazarmark%2Ftemporal-intro-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagikazarmark%2Ftemporal-intro-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagikazarmark","download_url":"https://codeload.github.com/sagikazarmark/temporal-intro-workshop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244849049,"owners_count":20520635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","hacktoberfest","temporal","workshop"],"created_at":"2024-10-12T14:07:38.424Z","updated_at":"2025-03-21T18:32:45.947Z","avatar_url":"https://github.com/sagikazarmark.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Temporal Intro Workshop\n\nThis repository contains example code for my [Temporal Intro Workshop](https://sagikazarmark.github.io/temporal-intro-workshop/). You can create your own Workshop with [my Workshop template](https://github.com/sagikazarmark/workshop-template).\n\nRecord: https://youtu.be/UwdGmdTO3Ts\n\nRecord (HUN): https://youtu.be/IGAnWQ52xOI\n\n\n## Prerequisites\n\n1. Git, Make, etc.\n2. Make sure you have the latest [Go](https://golang.org/) and [Docker](https://www.docker.com/get-started) installed\n\nAlternatively, install [nix](https://nixos.org) and [direnv](https://direnv.net), then run `direnv allow` once you checked out the repository.\n\n_Note: you should still install Docker using your native package manager._\n\n\n## Usage\n\n1. Checkout this repository\n2. Run `make up`\n3. Wait for Temporal to start\n4. Check if Temporal is running with `make ps`\n5. Start a new shell with `make shell`\n\nAlternatively, you can use the following alias for the `tctl` commands instead of opening a new shell:\n\n```shell\nalias tctl='docker compose exec --profile cli temporal-admin-tools tctl'\n```\n\n\n## Running a workflow using the CLI\n\nYou can run a workflow using the CLI with the following command:\n\n```bash\ntctl workflow run --taskqueue workshop --execution_timeout 60 --workflow_type WORKFLOW_TYPE -i 'arg1 arg2...'\n```\n\nAs a best practice, workflows generally have a single input struct (to remain compatible with other languages).\nBy default, Temporal uses JSON encoding, so such workflow execution looks like this:\n\n```bash\ntctl workflow run --taskqueue workshop --execution_timeout 60 --workflow_type example01 -i '{\"A\": 1, \"B\": 2}'\n```\n\nYou can shorten the command a lot by using shorthands for commands and options:\n\n```bash\ntctl wf run --tq workshop --et 60 --wt example01 -i '{\"A\": 1, \"B\": 2}'\n```\n\nLast, but not least, if you want to start a workflow without waiting for its result,\nyou can do so by using the `start` command instead of `run`:\n\n```bash\ntctl wf start --tq workshop --et 60 --wt example01 -i '{\"A\": 1, \"B\": 2}'\n```\n\n\n## Quering workflow state using the CLI\n\nWorkflows can register query handlers to expose state about themselves. You can query that state using the following command:\n\n```bash\ntctl workflow query --workflow_id 72daa600-3cac-49b0-9e86-277a47c80a87 --query_type current_number\n```\n\nOr using a shorter version:\n\n```bash\ntctl wf query --wid 72daa600-3cac-49b0-9e86-277a47c80a87 --qt current_number\n```\n\nThere is a special query type called `__stack_trace` that gives you the current stack trace of the workflow.\nUseful if a workflow is stuck for a long time and you want to check where it stopped.\n\n\n## Signaling a workflow using the CLI\n\nWorkflows can register query handlers to expose state about themselves. You can query that state using the following command:\n\n```bash\ntctl workflow signal --workflow_id 72daa600-3cac-49b0-9e86-277a47c80a87 --name set_number --input '2'\n```\n\nOr using a shorter version:\n\n```bash\ntctl wf signal --wid 72daa600-3cac-49b0-9e86-277a47c80a87 -n set_number -i '2'\n```\n\nThere is a special query type called `__stack_trace` that gives you the current stack trace of the workflow.\nUseful if a workflow is stuck for a long time and you want to check where it stopped.\n\n\n## Cleaning up\n\nOnce you are finished with the workshop, you can clean up all resources (containers) by running the following command:\n\n```bash\nmake down\n```\n\n\n## Development\n\nMake sure [nix](https://nixos.org) and [direnv](https://direnv.net) are installed, then run `direnv allow`.\n\nTo work on the slides, run `make slides`.\nIt will open a browser window and automatically refresh the page when you make changes to the slides.\n\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagikazarmark%2Ftemporal-intro-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagikazarmark%2Ftemporal-intro-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagikazarmark%2Ftemporal-intro-workshop/lists"}