Context and Task
Data Context is an object injected into logic functions at runtime, which containes some key components:
Data Context is an object injected into logic functions at runtime, which containes some key components:
Connecting external databases with built-in drivers. Currently the following databases are supported:
Emit and query LOC data events.
Accessing and writing files. Supports the following storages:
For sending HTTP requests to specific hosts.
LOC SDK is a downloadable NPM package that defines the interfaces of data context as well as agents - a series of features provided by LOC's logic runtime that can read and/or write internal and external storages.
For sharing data between tasks of one data process, which can stay persistent for a period of time.
Log (debugging) messages to LOC.
Read a local environment variable (not to be confused with local storage data or secrets in agent configurations). These variable can be set via Studio or CLI, which are useful for configuring a data process' behavior without modifying the logic code.
Sending emails with a SMTP server.
Payload is the data sent by triggers as initial input and is accessible from the context object. Currently there are two payload types:
This quick start will go through a tutorial of building a simple "Hello World" data process in LOC Studio using JavaScript.
Finalise a JSON object as the result data. If the trigger is synchronized API route or message queue, it will be returned to the trigger, otherwise stored in LOC to be retrieved later.
For sharing data between logic during a task (execution) of a data process.