Skip to main content

Display a form

Form with a name input

index.ts
import { App, type AppSchema } from '@latechforce/engine';

const schema: AppSchema = {
forms: [
{
id: 1,
name: 'contact-us',
title: 'Contact us',
description: 'Please fill in the form below to contact us.',
path: '/contact-us',
action: '/api/automations/throw-error',
inputs: [
{
name: 'name',
label: 'Name',
description: 'Please enter your name',
placeholder: 'Enter your name',
required: true,
type: 'single-line-text',
},
],
},
],
automations: [
{
id: 1,
name: 'contact-us',
trigger: {
service: 'http',
event: 'post',
params: {
path: '/throw-error',
},
},
actions: [
{
name: 'throw-error',
service: 'code',
action: 'run-typescript',
params: {
code: String(function () {
throw new Error('This is an error message');
}),
},
},
],
},
],
};

await new App().start(schema);

Automation


Run TypeScript code action

Trigger an automation with a cron time

Trigger an automation with an HTTP POST request with request body and respond immediately

Trigger an automation with an HTTP POST request

Trigger an automation with an HTTP POST request and respond immediately

Trigger an automation with an HTTP POST request with request body

Trigger an automation with an HTTP GET request

Trigger an automation with an HTTP GET request and respond immediately

Trigger an automation when a record is updated

Trigger an automation when a record is created

Respond to an HTTP request with a static body

Respond to an HTTP request

Respond to an HTTP request with a dynamic body

Create record action

Run TypeScript code action with input data

Run TypeScript code action with log

Run TypeScript code action

Run TypeScript code action with externals

Run JavaScript code action with input data

Run JavaScript code action with log

Run JavaScript code action

Run JavaScript code action with externals