Files
hatchet/sdks/ruby/examples/hatchet_client.rb
Gabe Ruttner 9692d0d2f3 feat(ruby): initial commit (#2086)
* initial commit

* init readme

* add gem-release

* tests

* lock file

* init examples

* bundle name

* feat: config

* example

* wip

* init api

* fix patch

* fix patch

* wip events feature

* runs client

* complete feature clients

* modern style

* cleanup

* rm generated

* since

* fix examples

* tests

* alpha

* rest

* rm rest

* fix: pre-commit

---------

Co-authored-by: mrkaye97 <mrkaye97@gmail.com>
2025-09-11 12:52:29 -04:00

31 lines
560 B
Ruby

#!/usr/bin/env ruby
require 'hatchet-sdk'
# require_relative '../src/lib/hatchet-sdk'
# Initialize the Hatchet client
hatchet = Hatchet::Client.new()
result = hatchet.events.create(
key: "test-event",
data: {
message: "test"
}
)
puts "Event created: #{result.inspect}"
run = hatchet.runs.create(
name: "simple",
input: {
Message: "test workflow run"
},
)
puts "TriggeredRun ID: #{run.metadata.id}"
result = hatchet.runs.poll(run.metadata.id)
puts "Runs client initialized: #{result.inspect}"
puts "Run status: #{result.run.status}"