<< All versions
Skill v1.0.1
currentAutomated scan100/100marciok/gust/elixir-dag-creator
+2 new
──Details
PublishedJune 24, 2026 at 01:47 AM
Content Hashsha256:479336dbecefaf5d...
Git SHA3e12ff011b52
Bump Typepatch
──Files
Files (1 file, 3.1 KB)
SKILL.md3.1 KBactive
SKILL.md · 114 lines · 3.1 KB
version: "1.0.1" name: Elixir DAG Creator description: Instructions for creating an Elixir DAG to run on Gust. Use this when you need to create a new DAG. license: Complete terms in LICENSE.txt
Gust DAG Creator
Use this guide to create a DAG in Elixir for Gust.
Create a DAG file
Create a valid Elixir module under dags/.
DAG syntax
The Gust DSL turns an Elixir module into a DAG.
When you add use Gust.DSL to a module in the dags/ folder, Gust detects it automatically. You can configure a schedule, define callbacks, and in development the DAG is reloaded when files change.
After enabling the DSL, define tasks with task.
Example
elixir
defmodule HelloWorld douse Gust.DSL, schedule: "* * * * *", on_finished_callback: :notify_somethingrequire Loggeralias Gust.Flowsdef notify_something(status, run) dodag = Flows.get_dag!(run.dag_id)Logger.info("DAG: #{dag.name}; completed with status: #{status}")enddef skip_first_task?(%{run_id: run_id}) dorun = Flows.get_run!(run_id)Map.get(run.params, "skip_first_task", false)endtask :first_task, downstream: [:second_task], save: true, skip_if: :skip_first_task? dogreeting = "Hi from first_task"Logger.info(greeting)%{result: greeting}endtask :second_task, ctx: %{run_id: run_id} dotask = Flows.get_task_by_name_run("first_task", run_id)Logger.info("#{inspect(task.result)}")endend
DSL options
schedule: a cron expressionon_finished_callback: the function called when the DAG finishes
Task options
:downstream— list of downstream task names:save— persists the task return value; when enabled, the return value must be a map:ctx— pattern matched against the task context; commonly%{run_id: run_id}:skip_if— name of a DAG module function that receives the task context and returns a boolean. If it returnstrue, Gust does not run the task body and marks the task as skipped. Downstream tasks that depend on a skipped upstream are skipped too.:map_over— name of an upstream task whose saved list result should start one parallel task instance per item. The upstream task must usesave: trueand return a list. Each item is passed asctx.params; map items are passed unchanged and scalar items are wrapped as%{"item" => value}. If the upstream list is empty, the mapped task is skipped.
Examples
elixir
task :simple_task doIO.puts("Hello")endtask :my_task, ctx: %{run_id: run_id} doIO.inspect(run_id)endtask :first, downstream: [:second] do:okendtask :persist_result, save: true do%{result: :ok}enddef skip_export?(%{run_id: run_id}) dorun = Gust.Flows.get_run!(run_id)Map.get(run.params, "skip_export", false)endtask :export, skip_if: :skip_export? do:okendtask :list_names, downstream: [:greet], save: true do["Ada", "Grace"]endtask :greet,map_over: :list_names,ctx: %{params: %{"item" => name}} doIO.puts("Hello #{name}")end
Validation
For example, if the file is dags/hello_world.ex, confirm that the hello_world DAG is valid.
Run command: mix gust.cli dag_definition hello_world