Appearance
Actions
Actions are the building blocks of Forge. An action runs your code each time the user submits a form or schedules the action to be ran. Actions can range from CRUD operations to workflow tasks.
ts
export default new Action(async () => {
const name = await io.input.text("Your name");
// run your code
return `Invited ${name}!`;
});
python
@forge.action(name="Customer Invitation Form")
async def customer_invitation(io: IO):
name = await io.input.text("Your name")
return f"Invited {name}"
Transactions
A transaction represents a single run for an Action. A transaction has the following states:
- Success - occurs when a transaction has completed
- Error - occurs when the transaction has an error
- Canceled - occurs when the user leaves the page or when the user explicitly cancels the transaction