Actionslink

Actions are functions that can be invoked on a node to make it do something. You would use an action to send an email, post on X (aka tweet), close a Github PR, etc. Invoking an action is how we ask a graph node to do something.

Invoking actions from the CLIlink

To invoke an action from the CLI you can use mctl action:

$ mctl action --help
Invokes an action

USAGE:
    mctl action <GREF>

ARGS:
    <GREF>    Action to invoke

As you can see, the only argument is the action itself. That's because actions are graph nodes too!

For example. This command invokes the "add" action in a To-Do program:

mctl action 'todo:add(title:"Make something awesome")'

Invoking actions from codelink

To invoke an action simply await it.

import { nodes } form 'membrane';

await nodes.todo.add({ title: "Make something awesome" });
...