{"id":13594579,"url":"https://github.com/direktiv/direktiv","last_synced_at":"2025-05-15T14:04:13.923Z","repository":{"id":37885230,"uuid":"341374526","full_name":"direktiv/direktiv","owner":"direktiv","description":"Serverless Container Orchestration","archived":false,"fork":false,"pushed_at":"2025-05-14T20:59:02.000Z","size":47981,"stargazers_count":480,"open_issues_count":43,"forks_count":42,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-14T21:50:58.528Z","etag":null,"topics":["golang","jq","kubernetes","orchestration","serverless","workflow","yaml"],"latest_commit_sha":null,"homepage":"http://www.direktiv.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/direktiv.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,"zenodo":null}},"created_at":"2021-02-23T00:10:16.000Z","updated_at":"2025-05-13T14:55:57.000Z","dependencies_parsed_at":"2022-07-09T10:31:20.256Z","dependency_job_id":"a2328bdf-5b24-4894-883f-21706384e08c","html_url":"https://github.com/direktiv/direktiv","commit_stats":null,"previous_names":["vorteil/direktiv"],"tags_count":106,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/direktiv%2Fdirektiv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/direktiv%2Fdirektiv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/direktiv%2Fdirektiv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/direktiv%2Fdirektiv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/direktiv","download_url":"https://codeload.github.com/direktiv/direktiv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355334,"owners_count":22057354,"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":["golang","jq","kubernetes","orchestration","serverless","workflow","yaml"],"created_at":"2024-08-01T16:01:35.952Z","updated_at":"2025-05-15T14:04:13.855Z","avatar_url":"https://github.com/direktiv.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","yaml","JavaScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/images/direktiv-logo-50.png\" alt=\"direktiv\"\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![License](https://img.shields.io/badge/License-Apache--2.0-blue)](#license)\n[![Go Report Card](https://goreportcard.com/badge/github.com/direktiv/direktiv)](https://goreportcard.com/report/github.com/direktiv/direktiv) \n[![GitHub release](https://img.shields.io/github/release/direktiv/direktiv.svg)](https://github.com/direktiv/direktiv/releases/)\n[![GitHub stars](https://badgen.net/github/stars/direktiv/direktiv)](https://github.com/direktiv/direktiv/stargazers/)\n[![GitHub contributors](https://img.shields.io/github/contributors/direktiv/direktiv.svg)](https://github.com/direktiv/badges/graphs/contributors/)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/direktiv/direktiv/graphs/commit-activity)\n[![made-with-Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](https://go.dev/)\n[![Slack](https://img.shields.io/badge/Slack-Join%20Direktiv-4a154b?style=flat\u0026logo=slack)](https://join.slack.com/t/direktiv-io/shared_invite/zt-zf7gmfaa-rYxxBiB9RpuRGMuIasNO~g)\n\n\u003c/div\u003e\n\n\n\u003ch1 align=\"center\"\u003eEvent-Driven Serverless Orchestration, Integration and Automation\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\nRun Workflows and Create Services in Seconds\n\u003c/div\u003e\n\u003c/br\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://docs.direktiv.io\"\u003eDocumentation\u003c/a\u003e\n    ·\n    \u003ca href=\"https://blog.direktiv.io\"\u003eBlog\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/direktiv/direktiv/issues/new?assignees=\u0026labels=\u0026projects=\u0026template=bug_report.md\u0026title=\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/direktiv/direktiv/issues/new?assignees=\u0026labels=\u0026projects=\u0026template=feature_request.md\u0026title=\"\u003eRequest Feature\u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"assets/images/direktiv.gif\" \u003e\u003c/div\u003e\n\n## Features \u0026 Standards\n\n* __YAML__: Define flows and subflows with simple YAML including if/else switches, error handling, retries, validations and more.\n* __Serverless__: Call multiple serverless functions from a flow and merge and modify the responses to a single consumable function call.\n* __Event-Based__: Catch events within the system or from external sources like AWS or Github and execute flows based on that event.\n* __JSON Inputs \u0026 States__: Use JSON as input for flows and respond with JSON to the caller. JSON will be saved between the states fo a flow.\n* __API Gateway__: Includes an API gateway to expose flows as services for third-party consumers including authentication.\n* __CloudEvents__: Supports CNCF's [CloudEvents](https://cloudevents.io/) natively.\n* __GitOps Approach__: All configurations, services and flows can be synced from Git. Git becomes the single source of truth.\n* __Observability__: Integrated into Fluent Bit (logging) \u0026 OpenTelemetry (instrumentation \u0026 tracing).\n* __Periodic Tasks__: Call flows periodically via cron jobs for repeating tasks. \n* __Scalable__: Direktiv scales on mulitple levels with Kubernetes scaling and [Knative's](https://knative.dev/docs/) scaling features.\n* __Easily Extendable__: Add custom functions with simple Docker containers.\n\n## Quick Start\n\nDirektiv provides a Docker container with all required components pre-installed (Linux only). The initial startup can take a couple of minutes to download all required images.\n\n```sh\ndocker run --privileged -p 8080:80 -ti direktiv/direktiv-kube\n```\n\n\u003e If the upper limit for inotify instances is too low the pods might be stuck in *pending*. Increase that limit if necessary with the command `sudo sysctl fs.inotify.max_user_instances=4096`\n\nIf you are not using Linux please follow the [installation instructions](https://docs.direktiv.io/installation/kubernetes/) on the documentation page. \n\n\n\n## About Direktiv\n\nDirektiv is an event-driven workflow engine made for **orchestration**, **integration**, and **automation**. In it's core it is a state machine which uses containers as functions within workflows and passes JSON structured data between states. It offers key features like retries, error handling, and conditional logic. The flow's state, stored as JSON, allows for dynamic transformations during execution using JQ or JavaScript.\n\n\u003ctable align=\"center\"\u003e\n  \u003ctr\u003e\n  \u003ctd\u003e\n\n```yaml\ndirektiv_api: workflow/v1\nstates:\n- id: start\n  type: noop\n  transform:\n    result: Hello world!\n  transition: second\n- id: second\n  type: noop\n  log: second state\n  transform:\n    final: this value is from state one jq(.result)\n```\n  \u003c/td\u003e\n  \u003ctd\u003e\n    \u003cimg src=\"assets/images/flow.png\" \u003e\n  \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nWorkflows can be triggered by events, start periodically via crons or can be started by a HTTP POST request where the data is the initial state fo the workflow. \n\n## Writing Workflows\n\nWriting workflows is a very simple task. The basic idea is that there are multiple states where the workflow steps through. These states are of different types to provide switches, errors or other functionality. The most important type is the `action` state. This state calls a function which is basically a simple container.\n\nWriting workflows is quite simple. Essentially, a workflow is progressing through different states with a JSOJ payload passed between those states. These states come in various types, providing switches, error management, and more. The most important type is the `action` state. The `action` state is basically a call to a container. Internally Direktiv spins up a serverless Knative function and passes data to that container. The response of that call becomes part of the JSON state of the flow.\n\n```yaml\ndirektiv_api: workflow/v1\n\nfunctions:\n- id: request\n  image: gcr.io/direktiv/functions/http-request:1.0\n  type: knative-workflow\n\nstates:\n- id: joke \n  type: action\n  action:\n    function: request\n    input: \n      method: GET\n      url: https://api.chucknorris.io/jokes/random?category=jq(.category // \"dev\")\n  transform:\n    joke: jq(.return[0].result.value)\n\n```\n\nThe above example is a very simple one-step workflow. It uses the `http-request` function. This function accepts multiple input parameters e.g. the HTTP method or the URL. The section under `input` defines the data send to the function as JSON. In this case Direktiv would post the following payload to the container:\n\n```json\n{\n  \"method\": \"GET\",\n  \"url\": \"https://api.chucknorris.io/jokes/random?category=dev\"\n}\n```\n\nIn this example, there's a JQ statement, `jq(.category // \"dev\")`, which is getting evaluated at runtime. If the 'category' value is defined in the state, it's utilized in the URL; otherwise, `dev` is used as the default. For instance, initiating the workflow with a payload like `{ \"category\": \"animal\" }` would result in the URL: `https://api.chucknorris.io/jokes/random?category=animal`.\n\nThe state can be transformed after each state of the workflow. In this case the JQ command fetches the joke from the return values of the function and sets it as new state.\n\n### Custom Functions\n\nAlthough every [standard container](https://docs.direktiv.io/getting_started/advanced/making-functions/#using-generic-containers) can be used in Direktiv it is easy to write a custom function if necessary. The basic requirement for a custom function is a container listening to port `8080` and accepting JSON as a payload. There is more information about writing custom functions in the [documentation](https://docs.direktiv.io/getting_started/advanced/making-functions/) but the following code snippet shows a very simple Rust example of a a custom function.\n\n```rust\nuse actix_web::{App, HttpResponse, HttpServer, Responder, post};\nuse actix_web::web::Json;\n\nuse serde::{Deserialize, Serialize};\n\n#[derive(Deserialize)]\nstruct Input {\n    name: String,\n}\n\n#[derive(Serialize)]\nstruct Output {\n    greeting: String,\n}\n\n#[post(\"/\")]\nasync fn index(info: Json\u003cInput\u003e) -\u003e impl Responder {\n    HttpResponse::Ok().json(Output { greeting: format!(\"Welcome to Direktiv, {}!\", info.name) })\n}\n\n#[actix_rt::main]\nasync fn main() -\u003e std::io::Result\u003c()\u003e {\n    HttpServer::new(|| {\n        App::new()\n            .service(index)\n    })\n        .bind(\"0.0.0.0:8080\")?\n        .run()\n        .await\n}\n```\n\n## Documentation\n\n- [Getting Started](https://docs.direktiv.io/getting_started/)\n- [Workflow Specification](https://docs.direktiv.io/spec/workflow-yaml/workflow/)\n- [Examples](https://docs.direktiv.io/examples/aws/)\n\n## Talk to us!\n\n- [Open Source Support Channel on Slack](https://join.slack.com/t/direktiv-io/shared_invite/zt-zf7gmfaa-rYxxBiB9RpuRGMuIasNO~g)\n\n\n## Code of Conduct\n\nWe have adopted the [Contributor Covenant](https://github.com/direktiv/.github/blob/master/CODE_OF_CONDUCT.md) code of conduct.\n\n## Contributing\n\nAny feedback and contributions are welcome. Read our [contributing guidelines](https://github.com/direktiv/.github/blob/master/CONTRIBUTING.md) for details.\n\n## License\n\nDistributed under the Apache 2.0 License. See `LICENSE` for more information.\n\n## See Also\n\n* The [direktiv.io](https://direktiv.io/) website.\n* The direktiv [documentation](https://docs.direktiv.io/).\n* The direktiv [blog](https://blog.direktiv.io/).\n* The [Godoc](https://godoc.org/github.com/direktiv/direktiv) library documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirektiv%2Fdirektiv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirektiv%2Fdirektiv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirektiv%2Fdirektiv/lists"}