base64_encode
Encode a string or file contents to base64.
Parameters
- inputstringone of
input,source_key, orfile - String to encode; supports
${ctx.key}interpolation. - source_keystringsee above
- Context key containing the string to encode.
- filestringsee above
- File path to read and encode.
- output_keystringdefault "base64_encoded"
- Context key for the encoded output.
- url_safebooldefault false
- Use URL-safe base64 alphabet.
Context Output
<output_key>(defaultbase64_encoded) — the base64 encoded string.
Example
local flow = Flow.new("encode_demo")
flow:step("encode", nodes.base64_encode({
input = "Hello, World!",
output_key = "encoded"
}))
flow:step("log", nodes.log({
message = "Encoded: ${ctx.encoded}"
})):depends_on("encode")
return flow