Skip to content
← Back to Index

invokeReactor

invokeReactor(
  reactorId: text
  method: text
  argument: { }|nothing
): value | <a href="/resources/components/runtimes/types/error/">Error</a>

The invokeReactor function allows Reactors to call methods from other (or current) Reactors and receive the result.

Availability

DiscountRuleReactor

Return Value

The return value from the call is the value returned from the given reactor.

Recursions and Loops

By having a reactor call itself it's possible to introduce recursion, and more specifically infinite recursion. To prevent this and ensure stable operations, there's a max call depth that will trigger an error. The limit for cloud instances are 10 calls, while enterprise instances may configure this.

Error Handling

Error may be returned if the specified reactorId or method doesn't exist, or the given argument is invalid.

Examples

filtrera
from invokeReactor(
  'myReactor',
  'myMethod'
) match
  Error |> 'An error occurred'
  (result: value) |> result

© 2024 Hantera AB. All rights reserved.