You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a new project directory create a new file `workflow.rb` like this:
25
-
**workflow.rb**
31
+
32
+
**workflow.rb**:
26
33
```ruby
34
+
require'factor-connector-web'
35
+
27
36
web_hook = run 'web::hook'
37
+
28
38
web_hook.on(:trigger) do |post_info|
29
-
if post_info[:configured]
30
-
success "Workflow is listening on #{hook_info[:configured][:url]}"
31
-
else
32
-
info "Received a hook call: #{post_info}"
33
-
end
39
+
if post_info[:configured]
40
+
success 'Configured and listening on...'
41
+
success post_info[:configured][:url]
42
+
else
43
+
info post_info
44
+
end
34
45
end
35
46
47
+
web_hook.on(:log) do |log_info|
48
+
debug log_info[:message]
49
+
end
50
+
51
+
web_hook.execute
36
52
web_hook.wait
37
53
```
38
54
39
55
Now run this from the command line:
40
-
`factor w`
56
+
```
57
+
bundle install
58
+
bundle exec factor w workflow.rb
59
+
```
60
+
61
+
## Next
62
+
63
+
-[Workflow Syntax](https://github.com/factor-io/factor/wiki/Workflow-Syntax): Factor.io workflows can do all sorts of magic, like running in parallel, aggregating command results, defining sequences, error handling, and more.
64
+
-[Connectors](https://github.com/factor-io/factor/wiki/Connectors): These are the officially support Connectors (integrations).
65
+
-[Custom Connectors](https://github.com/factor-io/factor/wiki/Creating-a-custom-connector): A guide for creating a custom Connector.
0 commit comments