Overview
The article discusses the open-source release of Starlark Worker, a tool that integrates Cadence workflow orchestration with the Starlark scripting language. It highlights the advantages of using Starlark for defining workflows, including expressiveness, serverless execution, and scalability.
What You'll Learn
1
How to define workflows using the Starlark scripting language
2
Why Starlark Worker simplifies workflow orchestration in multi-tenant environments
3
When to use Starlark for complex control flows in workflows
Prerequisites & Requirements
- Understanding of workflow orchestration concepts
- Familiarity with Cadence workflow platform(optional)
Key Questions Answered
What are the advantages of using Starlark for workflow definitions?
Starlark provides an expressive workflow language that allows developers to use familiar programming constructs, enabling complex control flows and data transformations. It also offers a serverless experience, allowing immediate workflow execution without the need for redeployment, and inherits scalability and reliability from Cadence's infrastructure.
How does the execution flow of Starlark Worker work?
The execution flow involves defining workflows in Starlark, submitting them to Cadence, executing them through Starlark Worker, and interpreting them using an extended Starlark interpreter. This process ensures seamless integration with Cadence's capabilities while maintaining workflow state management.
What is the significance of deterministic execution in Starlark?
Starlark's hermetic execution model ensures that workflows are deterministic, preventing non-deterministic operations that can complicate workflow execution. This design aligns with Cadence's requirements for reliable workflow code, making it suitable for production systems.
What are some domain-specific functions provided by Starlark Worker?
Starlark Worker extends the Starlark interpreter with functions like sleep for pausing execution, uuid for generating unique identifiers, and http.do for making HTTP requests. These functions integrate seamlessly with Cadence, enabling reliable and fault-tolerant operations.
Key Statistics & Figures
Monthly workflow executions handled by Cadence
12 billion
This statistic highlights the scale at which Cadence operates, showcasing its robustness and reliability in managing workflow orchestration.
Technologies & Tools
Backend
Cadence
Used as the workflow orchestration platform that Starlark Worker integrates with.
Scripting Language
Starlark
Serves as the scripting language for defining workflows in a Python-like syntax.
Key Actionable Insights
1Leverage Starlark's expressive syntax to define complex workflows that require conditional logic and data transformations.This is particularly useful in scenarios where workflows need to handle dynamic data or complex decision-making processes, allowing for greater flexibility and maintainability.
2Utilize the serverless capabilities of Starlark Worker to deploy workflows without the overhead of managing worker instances.This approach is beneficial in multi-tenant environments where resource efficiency is critical, enabling teams to focus on workflow development rather than infrastructure management.
3Take advantage of Cadence's built-in scalability and reliability features when using Starlark Worker.By inheriting these capabilities, developers can ensure that their workflows are robust and can handle high execution volumes without performance degradation.
Common Pitfalls
1
Overcomplicating workflow definitions by using overly complex control flows.
This can lead to maintenance challenges and reduced readability. It's important to balance complexity with clarity, ensuring that workflows remain understandable and manageable.
Related Concepts
Workflow Orchestration
Scripting Languages
Mlops
Multi-tenant Architecture